public static Document getDocument ( InputStream stream ) { try { return newDocumentBuilder ( ) . parse ( stream ) ; } catch ( SAXException e ) { logger . warn ( "Parsing error when building Document object from xml data." , e ) ; } catch ( IOException e ) { logger . warn ( "Reading error when building Document object from xml data." , e ) ; } return null ; }
Parse an XML coming from an input stream to DOM