code: private Document getDOMObject(String filename, boolean validating)
  			throws SAXException, IOException, ParserConfigurationException {
  
  		// Create a builder factory
  
  		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
  		if (!validating) {
  			factory.setValidating(validating);
  			factory.setSchema(null);
  			factory.setNamespaceAware(false);
  		}
  
  		DocumentBuilder builder = factory.newDocumentBuilder();
  		// Create the builder and parse the file
  		Document doc = builder.parse(new File(filename));
  		return doc;
  	}
docs: Parse a file containing an XML document, into a DOM object.
  
  @param filename
  A path to a valid file.
  @param validating
  True iff validating should be turned on.
  @return A DOM Object containing a parsed XML document or a null value if
  there is an error in parsing.
  @throws ParserConfigurationException
  @throws IOException
  @throws SAXException