/src/main/java/org/htmlunit/util/XmlUtils.java
factory.newInstance( ) ;
factory.setNamespaceAware ( true ) ;
public static Document buildDocument(final WebResponse webResponse) throws IOException, SAXException, ParserConfigurationException { final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); if (webResponse == null) { return factory.newDocumentBuilder().newDocument(); } <extra_id_0> final InputStreamReader reader = new InputStreamReader( new BOMInputStream(webResponse.getContentAsStream()), webResponse.getContentCharset()); final TrackBlankContentAndSkipLeadingWhitespaceReader tracker = new TrackBlankContentAndSkipLeadingWhitespaceReader(reader); final InputSource source = new InputSource(tracker);