question: public static Document createDOM ( InputStream is ) throws ParserConfigurationException , SAXException , IOException { DocumentBuilderFactory dbf = DocumentBuilderFactory . newInstance ( ) ; dbf . setValidating ( false ) ; dbf . setIgnoringComments ( false ) ; dbf . setIgnoringElementContentWhitespace ( true ) ; dbf . setNamespaceAware ( true ) ; dbf . setFeature ( XMLConstants . FEATURE_SECURE_PROCESSING , true ) ; dbf . setFeature ( DISALLOW_DOCTYPE_DECL , true ) ; dbf . setFeature ( EXTERNAL_GENERAL_ENTITIES , false ) ; dbf . setFeature ( EXTERNAL_PARAMETER_ENTITIES , false ) ; dbf . setFeature ( LOAD_EXTERNAL_DTD , false ) ; DocumentBuilder db = null ; db = dbf . newDocumentBuilder ( ) ; db . setEntityResolver ( new NullResolver ( ) ) ; db . setErrorHandler ( new SamlParserErrorHandler ( ) ) ; return db . parse ( is ) ; }
target:  Create Dom from iostream.