question: public static String fromDoc2String ( Document doc ) throws IOException { KXmlSerializer serializer = new KXmlSerializer ( ) ; ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; serializer . setFeature ( "http://xmlpull.org/v1/doc/features.html#indent-output" , true ) ; serializer . setOutput ( bos , XformConstants . DEFAULT_CHARACTER_ENCODING ) ; doc . write ( serializer ) ; serializer . flush ( ) ; return new String ( bos . toByteArray ( ) , XformConstants . DEFAULT_CHARACTER_ENCODING ) ; }
target:  Converts an xml document to a string.