title: XML Parsing - Null Object Reference - Android
body: <p>I am parsing XML datas, but when in XML is tag without text (only <code>&lt;item/&gt;</code> ) it writes error:               </p>
  
  <blockquote>
    <p>java.lang.NullPointerException: Attempt to invoke interface method
    'java.lang.String org.w3c.dom.Node.getNodeValue()' on a null object
    reference</p>
  </blockquote>
  
  <p>This is function where I get error:</p>
  
  <pre><code>private static String getNode(String sTag, Element eElement) {
      NodeList nlList = eElement.getElementsByTagName(sTag).item(0)
              .getChildNodes();
      Node nValue = (Node) nlList.item(0);
      return nValue.getNodeValue(); //here I get error
  }
  </code></pre>
  
  <p>Can somebody help me with this problem?
  Thank you very much.</p>