code: private final Document parse (final File schemaLocation, final File configFile) throws ConfigurationException {
          try {
              final SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
              final Schema schema = schemaFactory.newSchema(schemaLocation);
  
              // create a validator for the document
              final Validator validator = schema.newValidator();
  
              final DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
              domFactory.setNamespaceAware(true); // never forget this
              final DocumentBuilder builder = domFactory.newDocumentBuilder();
              final Document doc = builder.parse(configFile);
  
              final DOMSource source = new DOMSource(doc);
              final DOMResult result = new DOMResult();
  
              validator.validate(source, result);
  
              return (Document) result.getNode();
          } catch (final SAXException exc) {
              throw new ConfigurationException(exc);
          } catch (final ParserConfigurationException exc) {
              throw new ConfigurationException(exc);
          } catch (final IOException exc) {
              throw new ConfigurationException(exc);
          }
      }
docs: Reads the given configuration file in memory and creates a DOM representation.
  
  @throws SAXException If this operation is supported but failed for some reason.
  @throws ParserConfigurationException If a <code>DocumentBuilder</code> cannot be created which satisfies the
  configuration requested.
  @throws IOException If any IO errors occur.