title: parsing xml file with simplexml in php
body: <p>The following xml is a shortened sample xml returned from a web service for which I do not control. Can someone tell me how to use simplexml to first read the number of records in stats, and then properly iterate the equipment items so I can display the item price and quantity? Thanks.</p>
  
  <pre><code>    &lt;?xml version="1.0"?&gt;
      &lt;response&gt;
       &lt;inventory&gt;
        &lt;warehouse&gt;
         &lt;stats&gt; 
          &lt;location&gt;Main&lt;/location&gt;
          &lt;reportTime&gt;3/9/2013 16:50 PM&lt;/reportTime&gt;
          &lt;records&gt;2&lt;/records&gt;
         &lt;/stats&gt;
         &lt;equipment&gt;
          &lt;item&gt;
           &lt;model&gt;B14&lt;/model&gt;
           &lt;status&gt;Active&lt;/status&gt;
           &lt;price&gt;410.33&lt;/price&gt;
           &lt;color&gt;blue&lt;/color&gt;
           &lt;qty&gt;100&lt;/qty&gt;
          &lt;/item&gt;
         &lt;/equipment&gt;
         &lt;equipment&gt;
          &lt;item&gt;
           &lt;model&gt;C15&lt;/model&gt;
           &lt;status&gt;Active&lt;/status&gt;
           &lt;price&gt;199.10&lt;/price&gt;
           &lt;color&gt;red&lt;/color&gt;
           &lt;qty&gt;200&lt;/qty&gt;
          &lt;/item&gt;
         &lt;/equipment&gt;
        &lt;/warehouse&gt;
       &lt;/inventory&gt;
      &lt;/response&gt;
  </code></pre>