// Implements XMLStreamWriter interface.
public void writeAttribute(CharSequence prefix, CharSequence namespaceURI,
CharSequence localName, CharSequence value)
throws XMLStreamException {
if (localName == null)
throw new XMLStreamException("Local name cannot be null");
if (value == null)
throw new XMLStreamException("Value cannot be null");
if (namespaceURI == null)
throw new XMLStreamException("Namespace URI cannot be null");
if (prefix == null)
throw new XMLStreamException("Prefix cannot be null");
writeAttributeOrNamespace(prefix, namespaceURI, localName, value);
}