You are building the XML as a String and you need to validate the XML right?
Many parsers accept either a File or an InputStream as input. So you could build an instance of java.io.StringBufferInputStream with your string and pass it on to the parser.
Good luck,
------------------
Ajith Kallambella M. Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.