code: public static void validateSchema(final File xsd, final File xml,
  		final ErrorHandler errorHandler)
  		throws SAXException, ParserConfigurationException, IOException
  	{
  
  		final Schema schemaXSD = getSchema(xsd, errorHandler);
  
  		// Create a Validator capable of validating XML files according to my custom schema.
  		final Validator validator = schemaXSD.newValidator();
  
  		// parse the XML DOM tree againts the stricter XSD schema
  		validator.validate(getDOMSource(xml, errorHandler));
  	}
docs: Validate xml through xsd.
  
  @param xsd
  the xsd
  @param xml
  the xml
  @param errorHandler
  the error handler
  @throws SAXException
  If a SAX error occurs during parsing.
  @throws ParserConfigurationException
  if a DocumentBuilder cannot be created which satisfies the configuration
  requested.
  @throws IOException
  Signals that an I/O exception has occurred.