code: public static Document parse(InputSource inputSource, Map<String, String> dtdMappings) {
  		SAXParserFactory factory = SAXParserFactory.newInstance();
  		factory.setValidating((dtdMappings != null));
  		factory.setNamespaceAware(true);
  		SAXParser parser = null;
  		try {
  			parser = factory.newSAXParser();
  		} catch (Exception ex) {
  			throw new WalkModException("Unable to create SAX parser", ex);
  		}
  		DOMBuilder builder = new DOMBuilder();
  		ContentHandler locationHandler = new LocationAttributes.Pipe(builder);
  		try {
  			parser.parse(inputSource, new StartHandler(locationHandler, dtdMappings));
  		} catch (Exception ex) {
  			throw new WalkModException(ex);
  		}
  		return builder.getDocument();
  	}
docs: Creates a W3C Document that remembers the location of each element in the
  source file. The location of element nodes can then be retrieved using
  the {@link #getLocationObject(Element)} method.
  
  @param inputSource
  the inputSource to read the document from
  @param dtdMappings
  a map of DTD names and public ids
  @return Document