public static Document loadDocument(URL url) throws Exception {
  DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
  DocumentBuilder builder=factory.newDocumentBuilder();
  return builder.parse(url.openStream());
}

public static Document loadDocument ( URL url ) throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory . newInstance ( ) ; DocumentBuilder builder = factory . newDocumentBuilder ( ) ; return builder . parse ( url . openStream ( ) ) ; }
loads a xml document from a url and returns the corresponding dom document .
