public static Document loadDocument(String uri){
  try {
    DocumentBuilderFactory docBuilderFactory=DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder=docBuilderFactory.newDocumentBuilder();
    return docBuilder.parse(uri);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}

public static Document loadDocument ( String uri ) { try { DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory . newInstance ( ) ; DocumentBuilder docBuilder = docBuilderFactory . newDocumentBuilder ( ) ; return docBuilder . parse ( uri ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return null ; }
returns a new dom document for the given uri .
