title: PHP XPath search returning 0 results
body: <p>Below I have a PHP script that I need to search through an XML file and find the ID for <code>&lt;AnotherChild&gt;</code>. For some reason, at the moment it returns 0 results and I can't figure out why. If anyone can see why it's returning 0 results I'd really appreciate it if they could let me know why.</p>
  
  <p>XML:</p>
  
  <pre><code>&lt;TransXChange xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.transxchange.org.uk/" xsi:schemaLocation="http://www.transxchange.org.uk/ http://www.transxchange.org.uk/schema/2.1/TransXChange_general.xsd" CreationDateTime="2013-07-12T18:12:21.8122032+01:00" ModificationDateTime="2013-07-12T18:12:21.8122032+01:00" Modification="new" RevisionNumber="3" FileName="swe_44-611A-1-y10.xml" SchemaVersion="2.1"&gt;
      &lt;Node1&gt;...&lt;/Node1&gt;
      &lt;Node2&gt;...&lt;/Node2&gt;
      &lt;Node3&gt;...&lt;/Node3&gt;
      &lt;Node4&gt;...&lt;/Node4&gt;
      &lt;Node5&gt;...&lt;/Node5&gt;
      &lt;Node6&gt;...&lt;/Node6&gt;
      &lt;Node7&gt;
          &lt;Child&gt;
              &lt;id&gt;ABCDEFG123&lt;/id&gt;
          &lt;/Child&gt;
          &lt;AnotherChild&gt;
              &lt;id&gt;ABCDEFG124&lt;/id&gt;
          &lt;/AnotherChild&gt;
      &lt;/Node7&gt;
      &lt;Node8&gt;...&lt;/Node8&gt;
  &lt;/TransXChange&gt;
  </code></pre>
  
  <p>PHP:</p>
  
  <pre><code>&lt;?php
  
    $xmldoc = new DOMDocument();
    $xmldoc-&gt;load("directory1/directory2/file.xml");
  
    $xpathvar = new DOMXPath($xmldoc);
    $xpathvar-&gt;registerNamespace('transXchange', 'http://www.transxchange.org.uk/');
  
    $queryResult = $xpathvar-&gt;query('//AnotherChild/id');
    foreach($queryResult as $result) {
      echo $result-&gt;textContent;
    }
  ?&gt;
  </code></pre>
  
  <p>Thanks</p>