title: DOMXPath get first value of query
body: <p>considering you're searching just one specific value is there to get the only and first result directly without parsing the result with foreach?
  Like this:</p>
  
  <pre><code>$elements = $dom_xpath-&gt;query('//span[@id="loginName"]');
  
  
  echo $elements-&gt;firstNode-&gt;nodeValue; // this doesn't exist of course
  </code></pre>
  
  <p>the html code is </p>
  
  <pre><code>&lt;div&gt;
    &lt;div id="name"&gt;text&lt;span id="loginName"&gt;Me&lt;/span&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>