public static Document readXml(InputStream is) throws SAXException, IOException, ParserConfigurationException {
  DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance();
  dbf.setValidating(false);
  dbf.setIgnoringComments(false);
  dbf.setIgnoringElementContentWhitespace(true);
  dbf.setNamespaceAware(true);
  DocumentBuilder db=null;
  db=dbf.newDocumentBuilder();
  db.setEntityResolver(new NullResolver());
  return db.parse(is);
}

public static Document readXml ( InputStream is ) throws SAXException , IOException , ParserConfigurationException { DocumentBuilderFactory dbf = DocumentBuilderFactory . newInstance ( ) ; dbf . setValidating ( false ) ; dbf . setIgnoringComments ( false ) ; dbf . setIgnoringElementContentWhitespace ( true ) ; dbf . setNamespaceAware ( true ) ; DocumentBuilder db = null ; db = dbf . newDocumentBuilder ( ) ; db . setEntityResolver ( new NullResolver ( ) ) ; return db . parse ( is ) ; }
read xml as dom .
