Here you can see how to validate XML using XSD:
File xsdFile = new File(${location});
Digester digester = new Digester();
digester.setValidating(true);
digester.setNamespaceAware(true);
digester.setErrorHandler(myErrorHandler); // Don't forget to set custom error handler
digester.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage",
"http://www.w3.org/2001/XMLSchema");
digester.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", xsdFile); // You can use File, String, InputStream, InputSource or an array of these type
digester.parse(...);