question: public void convertToXml ( OutputStream os , String charset ) throws IOException { out = new OutputStreamWriter ( os , Charset . forName ( charset ) ) ; if ( rootTag != null ) { out . write ( "<" + rootTag + ">" + System . lineSeparator ( ) ) ; } PdfStructTreeRoot structTreeRoot = document . getStructTreeRoot ( ) ; if ( structTreeRoot == null ) throw new PdfException ( PdfException . DocumentDoesntContainStructTreeRoot ) ; inspectKids ( structTreeRoot . getKids ( ) ) ; if ( rootTag != null ) { out . write ( "</" + rootTag + ">" ) ; } out . flush ( ) ; out . close ( ) ; }
target:  Converts the current tag structure into an XML file with provided encoding.