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