title: SimpleXMLElement get first XPath Element in one line
body: <p>Just trying to figure a shorter way to do this:</p>
  
  <p>I'm using simpleXMLElement to parse an xml file and it's aggravating to have to call two lines to process an array when I know what node I want.</p>
  
  <p>Current code:</p>
  
  <pre><code>$xml = new SimpleXMLElement($data);
  $r = $xml-&gt;xpath('///givexNumber');
  $result["cardNum"] = $r[0];
  </code></pre>
  
  <p>What I would like to do would be something like I can do with DomX</p>
  
  <pre><code>$result["cardNum"] = $xml-&gt;xpath('///givexNumber')-&gt;item(0)-&gt;nodeValue;
  </code></pre>