class StubConfigSchemaParser {

    public Schema parseSchema() {
        Schema result;
        try {
            URL schemaFile = resourceLoader.loadResource(stubConfigSchemaLocation);
            SchemaFactory schemaFactory = schemaFactoryBuilder.buildSchemaFactory();
            result = schemaFactory.newSchema(schemaFile);
        } catch (SAXException e) {
            throw new DescriptorValidationFailedException("Parsing of stub config XSD failed.", e);
        }
        return result;
    }

}