class XMLValidator extends IXMLValidator {

    @Override
    public void validateXML(File xmlFile, URL xsdUrl) {
        Validate.notNull(xmlFile, "No URL to xml file provided!");
        if (xsdUrl != null) {
            SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
            try {
                Schema schema = factory.newSchema(xsdUrl);
                Validator validator = schema.newValidator();

                StreamSource source = new StreamSource(xmlFile);
                validator.validate(source);
            } catch (SAXException e) {
                LOGGER.error("Invalid XML", e);
                throw new ConfigurationException("The config File " + xmlFile + " could not be validated against" + xsdUrl, e);
            } catch (IOException e) {
                LOGGER.error("File access failing", e);
                throw new ConfigurationException("The config File could not be validated", e);
            }
        }
    }

}