Validator validator = schema.newValidator(); validator.validate(new DOMSource(document)); The Schema classes are found in the java package javax.xml.validation. The DOMSource classes are found in the java package javax.xml.transform. If the validation fails, an exception is thrown. You can also set an error handler on the Validator object. Thus, you can collect multiple schema errors in the same document.