title: DOMXpath - Get href attribute and text value of an a element
body: <p>So I have a HTML string like this:</p>
  
  <pre><code>&lt;td class="name"&gt;
     &lt;a href="/blah/somename23123"&gt;Some Name&lt;/a&gt;
  &lt;/td&gt;
  &lt;td class="name"&gt;
     &lt;a href="/blah/somename28787"&gt;Some Name2&lt;/a&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>Using XPath I'm able to get value of href attribute using this Xpath query:</p>
  
  <pre><code> $domXpath = new \DOMXPath($this-&gt;domPage);
   $hrefs = $domXpath-&gt;query("//td[@class='name']/a/@href");
   foreach($hrefs as $href) {...}
  </code></pre>
  
  <p>And It's even easier to get a text value, like this:</p>
  
  <pre><code> // Xpath auto. strips any html tags so we are 
   // left with clean text value of a element
   $domXpath = new \DOMXPath($this-&gt;domPage);
   $names = $domXpath-&gt;query("//td[@class='name']/");
   foreach($names as $name) {...}
  </code></pre>
  
  <p>Now I'm curious to know, how can I combine those two queries to get both values with only one query (If it's something like that even posible?).</p>