The Java XML Validation API

Validation reports whether a document adheres to the rules specified by the schema. Different parsers and tools support different schema languages such as DTDs, the W3C XML Schema Language, RELAX NG, and Schematron. This is a good guide to learn about this XML validation API and how Java 5 adds a uniform validation Application Programming Interface (API) that can compare documents to schemas written in these and other languages.