You could use the
XMLSerializer that comes bundled with Xerces.
Here's a small code example -
Note that since XMLSerializer can write to any OutputStream, you can either write to a file or a String.
Hope that helps!
------------------
Ajith Kallambella M. Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.
[This message has been edited by Ajith Kallambella (edited June 07, 2001).]