Take a look at org.apache.xml.serialize package. Boris Garbuzov wrote:
> What people use to print DOM document in Xerces for Java? It is left > outside the core? Why not put to the core any default writer class > like DOMWriter from the samples? Can I use DOMWriter for commercial > needs, a little modifying it and inserting to my source tree? Some > other writing extensions for Xerces?