title: Php and Xpath - how to get text from inside a node
body: <p>How how can I get a text from inside a node using xpath?</p>
  
  <p>For now I'm doing it like this:</p>
  
  <pre><code>$temp= $content-&gt;xpath('qwe/qwe');
  $temp = each($temp[0]);
  return $temp['value'];
  </code></pre>
  
  <p>But as you can see it's far from good solution :(</p>
  
  <p>In c# it is as easy as </p>
  
  <pre><code>public string readXmlVar(string xpath)
  {
      XmlNode xmlNode = xml.SelectSingleNode(xpath);
      return xmlNode.InnerText;
  }
  </code></pre>