question: public static Document readDocument ( InputStream in , String encoding ) throws IOException , XMLException { try { InputStreamReader reader = new InputStreamReader ( in , encoding ) ; InputSource source = new InputSource ( new BufferedReader ( reader ) ) ; Document document ; try { document = documentBuilder . parse ( source ) ; } catch ( SAXException e ) { throw new XMLException ( "readDocument failed" , e ) ; } return document ; } finally { in . close ( ) ; } }
target:  Creates a Document instance from a Reader reading an XML input stream.