public static Document asDocument( File webXML ) throws DocumentException, SAXException {
        // Make the reader non-validating so that it doesn't try to resolve external DTD's. Trying to resolve
        // external DTD's can break on some firewall configurations.
        SAXReader saxReader = new SAXReader( false);
        saxReader.setFeature( "http://apache.org/xml/features/nonvalidating/load-external-dtd", false );
        saxReader.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
        saxReader.setFeature("http://xml.org/sax/features/external-general-entities", false);
        saxReader.setFeature("http://xml.org/sax/features/external-parameter-entities", false);

        return saxReader.read( webXML );
    }
Utilities to extract data from a web.xml file.

@author Guus der Kinderen, guus.der.kinderen@gmail.com
xmppserver/src/main/java/org/jivesoftware/util/WebXmlUtils.java