question: private static String serializeDocumentInt ( Document doc ) throws TransformerException , IOException { ByteArrayOutputStream s = new ByteArrayOutputStream ( ) ; TransformerFactory factory = TransformerFactory . newInstance ( ) ; Transformer transformer = factory . newTransformer ( ) ; transformer . setOutputProperty ( OutputKeys . METHOD , "xml" ) ; transformer . setOutputProperty ( OutputKeys . INDENT , "yes" ) ; DOMSource source = new DOMSource ( doc ) ; StreamResult outputTarget = new StreamResult ( s ) ; transformer . transform ( source , outputTarget ) ; return s . toString ( "UTF8" ) ; }
target:  Serializes a XML document into a string - encoded in UTF8 format, with platform line separators.