public static Document getResourceAsDocument(Class<?> requestingClass, String resource)
            throws ResourceMissingException, IOException, ParserConfigurationException,
                    SAXException {

        // Default is non-validating...
        return getResourceAsDocument(requestingClass, resource, false);
    }
public static Document getResourceAsDocument ( Class < ? > requestingClass , String resource ) throws ResourceMissingException , IOException , ParserConfigurationException , SAXException { return getResourceAsDocument ( requestingClass , resource , false ) ; }
Get the contents of a URL as an XML Document, first trying to read the Document with
validation turned on, and falling back to reading it with validation turned off.

@param requestingClass the java.lang.Class object of the class that is attempting to load the
resource
@param resource a String describing the full or partial URL of the resource whose contents to
load
@return the actual contents of the resource as an XML Document
@throws ResourceMissingException
@throws java.io.IOException
@throws javax.xml.parsers.ParserConfigurationException
@throws org.xml.sax.SAXException