title: Xpath get specific attribute values
body: <p>i got this XML:</p>
  
  <pre><code>            &lt;shipping_line&gt;
                  &lt;article id="960382" quantity="500" /&gt;
                  &lt;article id="960560" quantity="150" /&gt;
                  &lt;article id="960426" quantity="250" /&gt;
                  &lt;article id="1177" quantity="100" &gt;
                      &lt;product&gt;5500070000126273&lt;/product&gt;
                      &lt;product&gt;5500070000126264&lt;/product&gt;
                      &lt;product&gt;5500070000126255&lt;/product&gt;
                      &lt;product&gt;5500070000126246&lt;/product&gt;
                      &lt;product&gt;5500070000126237&lt;/product&gt;
                  &lt;/article&gt;
              &lt;/shipping_line&gt;
  </code></pre>
  
  <p>and i access the article elements <code>atributes</code> id and <code>quantity</code> like this:</p>
  
  <pre><code>$atrs = $xml-&gt;xpath('//article[not(node())]/@quantity | //article[not(node())]/@id');
  </code></pre>
  
  <p>now i would like to access the 2 values i made a foreach like this: </p>
  
  <pre><code>            foreach ($atrs as $id =&gt; $val ) {
  
                  error_log(print_r($val , true));
  
              }
  </code></pre>
  
  <p>And my error log shows this:</p>
  
  <pre><code> SimpleXMLElement Object\n(\n    [@attributes] =&gt; Array\n        (\n            [id] =&gt; 960382\n        )\n\n)\n
   SimpleXMLElement Object\n(\n    [@attributes] =&gt; Array\n        (\n            [quantity] =&gt; 500\n        )\n\n)\n
   SimpleXMLElement Object\n(\n    [@attributes] =&gt; Array\n        (\n            [id] =&gt; 960560\n        )\n\n)\n
   SimpleXMLElement Object\n(\n    [@attributes] =&gt; Array\n        (\n            [quantity] =&gt; 150\n        )\n\n)\n
   SimpleXMLElement Object\n(\n    [@attributes] =&gt; Array\n        (\n            [id] =&gt; 960426\n        )\n\n)\n
   SimpleXMLElement Object\n(\n    [@attributes] =&gt; Array\n        (\n            [quantity] =&gt; 250\n        )\n\n)\n
  </code></pre>
  
  <p>how could i access the 2 values so i can use a function like 
  <code>someFunctionUsing2Values($article_no , $quantity)</code> </p>