If Sun's package doesn't do this for you, please let us know,
since it's supposed to do that! (Beware of huge strings, of
course...) That could change in a future release; comments?
Document d = XmlDocumentbuilder.createDocument (...);
String s = d.toString ();
Similarly, the nodes in that version of DOM all implement an
additional method: void write (Writer) which emits the node
as XML (not pretty-printed though). That API should certainly
change, though; it's a bit too XML-specific for such a general
method name.
- Dave