doc.appendChild( root ); // Add Root to Document
OutputFormat format = new OutputFormat( doc ); //Serialize DOM
StringWriter stringOut = new StringWriter(); //Writer will be a String
XMLSerializer serial = new XMLSerializer( stringOut, format );
serial.asDOMSerializer(); // As a DOM Serializer
serial.serialize( doc.getDocumentElement() );
System.out.println( "STRXML = " + stringOut.toString() ); //Spit out DOM as a String
} catch ( Exception ex ) {