Java tutorial
//package com.java2s; import javax.xml.parsers.*; import org.w3c.dom.*; public class Main { public static Node loadURL(java.net.URL url) { Document document = null; if (url != null) { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); document = builder.parse(url.openStream()); } catch (java.io.IOException ioe) { document = null; ioe.printStackTrace(); } catch (ParserConfigurationException pce) { document = null; pce.printStackTrace(); } catch (org.xml.sax.SAXException se) { document = null; se.printStackTrace(); } return document; } return null; } }