title: xpath with simplexml not able to access nested element
body: <p>I have an xml like so:</p>
  <pre><code>  &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
    &lt;foo SeqNum=&quot;1&quot;&gt;
      &lt;bar&gt;1234&lt;/bar&gt;
    &lt;/foo&gt;
    &lt;foo SeqNum=&quot;20&quot;&gt;
      &lt;bar&gt;6789&lt;/bar&gt;
    &lt;/foo&gt;
  </code></pre>
  <p>and I'm trying to get the value <code>6789</code> with this query:</p>
  <pre><code>$xml = &quot;&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
    &lt;foo SeqNum=&quot;1&quot;&gt;
      &lt;bar&gt;1234&lt;/bar&gt;
    &lt;/foo&gt;
    &lt;foo SeqNum=&quot;20&quot;&gt;
      &lt;bar&gt;6789&lt;/bar&gt;
    &lt;/foo&gt;&quot;;
  $simple = new SimpleXMLElement($xml);
  $result = $simple-&gt;xpath('//*[@SeqNum=&quot;20&quot;]/bar/'); // result gives me nothing
  </code></pre>
  <p>So I tried to just get the parent like so</p>
  <pre><code>$result = $simple-&gt;xpath('//*[@SeqNum=&quot;20&quot;]')[0]-&gt;asXML();
  </code></pre>
  <p>which gives me:</p>
  <pre><code>  &lt;foo SeqNum=&quot;20&quot;&gt;
      &lt;bar&gt;6789&lt;/bar&gt;
    &lt;/foo&gt;
  </code></pre>
  <p>So I'm almost there but am really stuck about what I'm not understanding. Thank you!</p>