I had the same problem with XMLSerializer that did not allow customization of empty tags. My solution was to extend the XMLSerializer source code and override the serializeElement method:
I copied the source code and changed the final part of the print:
protected void serializeElement (Elem) throws an IOException
...
if (isSelfClosingElement(elem))
_printer.printText("/>");
else
_printer.printText("></" + elem.getTagName() + ">");
where isSelfClosingElement contains a list of self-closing elements
: printAttribute() printNamespaceAttr(), , .