title: Always get null when querying XML with XPath
body: <p>I am using the following code to query some XML with XPath I get from a stream.</p>
  
  <pre><code>DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
  domFactory.setNamespaceAware(false);
  DocumentBuilder builder = domFactory.newDocumentBuilder();
  Document doc = builder.parse(inputStream);
  inputStream.close();
  
  XPathFactory factory = XPathFactory.newInstance();
  XPath xpath = factory.newXPath();
  XPathExpression expr = xpath.compile("//FOO_ELEMENT");
  
  Object result = expr.evaluate(doc, XPathConstants.NODESET);
  NodeList nodes = (NodeList) result;
  for (int i = 0; i &lt; nodes.getLength(); i++) {
      System.out.println(nodes.item(i).getNodeValue());
  </code></pre>
  
  <p>I have checked the stream for content by converting it to a string - and it's all there - so it's not as if there is no data in the stream.</p>
  
  <p>This is just annoying me now - as I have tried various different bits of code and I still keep getting 'null' being printed at the "System.out.println" line  - what am I missing here?</p>
  
  <p>NOTE: I want to see the text inside the element.</p>