title: How get value using xPath php
body: <p>i have an xml like:</p>
  
  <pre><code>&lt;AvailableCatgs&gt;
     &lt;AvailableCatg&gt;
        &lt;CategoryCode&gt;01&lt;/CategoryCode&gt;
        &lt;Pr&gt;1857.48&lt;/Pr&gt;
     &lt;/AvailableCatg&gt;
      &lt;AvailableCatg&gt;
        &lt;CategoryCode&gt;13&lt;/CategoryCode&gt;
        &lt;Pr&gt;1900.40&lt;/Pr&gt;
     &lt;/AvailableCatg&gt;
     &lt;AvailableCatg&gt;
        &lt;CategoryCode&gt;09&lt;/CategoryCode&gt;
        &lt;Pr&gt;22.3&lt;/Pr&gt;
     &lt;/AvailableCatg&gt;
  &lt;/AvailableCatgs&gt;
  </code></pre>
  
  <p>I have to loop all <code>AviableCatgs</code> and take value of <code>CategoryCode</code> and <code>Pr</code>. What i've done is:</p>
  
  <pre><code>$xpath = new DOMXPath($mainXml);
  $path = "//AvailableCatg";
  $res = $xpath -&gt; query($path);
  foreach ($res as $aviable) {
     print_r($aviable-&gt;CategoryCode-&gt;nodeValue);
  }
  </code></pre>
  
  <p>But it doesn't print me nothing...
  How can i do? thanks!!</p>