title: Count nodes with xpath and count
body: <p>I have the following code:</p>
  
  <pre><code>&lt;?php
  $xmlString = '
          &lt;SHOP xmlns="http://www.example.com/ns/offer/1.0"&gt;
              &lt;SHOPITEM&gt;
                  &lt;ID&gt;1&lt;/ID&gt;
                  &lt;PRODUCT&gt;T-shirt&lt;/PRODUCT&gt;
                  &lt;PRICE&gt;19,22&lt;/PRICE&gt;
              &lt;/SHOPITEM&gt;
              &lt;SHOPITEM&gt;
                  &lt;ID&gt;2&lt;/ID&gt;
                  &lt;PRODUCT&gt;Trousers&lt;/PRODUCT&gt;
                  &lt;PRICE&gt;87,54&lt;/PRICE&gt;
              &lt;/SHOPITEM&gt;
          &lt;/SHOP&gt;';
  $xml = simplexml_load_string($xmlString);
  $x_s_products = $xml-&gt;xpath("/SHOP/SHOPITEM");
  $cnt_x_products = count($x_s_products);
  echo $cnt_x_products;
  ?&gt;
  </code></pre>
  
  <p>The problem is that the <code>$cnt_x_products</code> is 0. But it is not true. If I delete <em>xmlns attribute</em>, everything is OK. But I must have this attribute there. Thank you for your advice.</p>