boolean validate(final Document dom) {
        try {
            InputStream is = 
                getClass().getResourceAsStream("/TIPPManifest-1_5.xsd");
            SchemaFactory factory = 
                SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI);
            factory.setResourceResolver(new LSResourceResolver() {
                public LSInput resolveResource(String type, String namespaceURI, 
                        String publicId, String systemId, String baseURI)  {
                    LSInput input = ((DOMImplementationLS)dom
                            .getImplementation()).createLSInput();
                    if (("TIPPCommon.xsd".equals(systemId) && W3C_XML_SCHEMA_NS_URI.equals(type)) ||
                         COMMON_SCHEMA_LOCATION.equalsIgnoreCase(baseURI)) {
                        input.setByteStream(getClass().getResourceAsStream("/TIPPCommon-1_5.xsd"));
                    }
                    else if (XMLDSIG_SCHEMA_URI.equalsIgnoreCase(baseURI) ||
                        XMLDSIG_NS_PREFIX.equalsIgnoreCase(namespaceURI)) {
                        input.setByteStream(getClass().getResourceAsStream("/xmldsig-core-schema.xsd"));
                    }
                    else if ("http://www.w3.org/2001/XMLSchema.dtd".equals(baseURI) ||
                             "http://www.w3.org/2001/XMLSchema.dtd".equals(systemId)) {
                        input.setByteStream(getClass().getResourceAsStream("/XMLSchema.dtd"));
                    }
                    else if ("datatypes.dtd".equals(systemId)) {
                        input.setByteStream(getClass().getResourceAsStream("/datatypes.dtd"));
                    }
                    else {
                        return null;
                    }
                    return input;
                }
            });
            Schema schema = factory.newSchema(new StreamSource(is));
            // need an errorHandler.reportError handler
            Validator validator = schema.newValidator();
            validator.validate(new DOMSource(dom));
            is.close();
            return true;
        }
        catch (SAXException | IOException e) {
            errorHandler.reportError(TIPPErrorType.INVALID_MANIFEST, "Invalid manifest", e);
            return false;
        }
    }