code: private static Document loadHTML(InputSource source, boolean useNamespace) throws SAXException, IOException {
  		DOMParser parser = new DOMParser();
  		// source http://nekohtml.sourceforge.net/faq.html#hierarchy
  		parser.setFeature(FEAT_NAMESPACES, useNamespace);
  		parser.parse(source);
  		return new DocumentImpl(parser.getDocument());
  	}
docs: Helper for loading HTML document from input source.
  
  @param source input source,
  @param useNamespace flag set to true if document should be name space aware.
  @return newly created HTML document.
  @throws SAXException if input source is not valid XML,
  @throws IOException if reading from input stream fails.