Hey Alek:
in short yes! XMLStreamWriter.writeEmptyElement() should be called from OM (see example below).
Ah, but writeEmptyElement() doesn't let you write attributes, does it? It can write <test/> but not <test foo="bar"/>, as I understand it.
however i wonder why you care - from XML 1,0 and Infoset point of view thos2e two are equivalent!
Optimization, less bytes on the wire, accurately reflecting the bytestream that came in one end (yes, I know that the infoset is the same, but I still think it's more polite to be able to accurately reproduce what you got) and went out the other.
BTW: to bad that solutoion from XmlPull API did nto survive in StAX i.e. it was intelligent to do <empty/> by default unless you called character("") in between.
+1, that's what Axis 1 does as well. --Glen
