title: How to load all xml:lang attributes with SimpleXML
body: <p>How to read ALL atribute <code>xml:lang</code> values?
  Sometimes I do not know how many languages are defined in XMLs data.</p>
  
  
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;offer&gt;
    &lt;products&gt;
      &lt;product&gt;
        &lt;description&gt;
          &lt;name xml:lang="eng"&gt;English translation&lt;/name&gt;
          &lt;name xml:lang="lat"&gt;Latvian translation&lt;/name&gt;
        &lt;/description&gt;
      &lt;/product&gt;
      &lt;product&gt;
        &lt;description&gt;
          &lt;name xml:lang="eng"&gt;The same English&lt;/name&gt;
          &lt;name xml:lang="pol"&gt;And Polish language&lt;/name&gt;
        &lt;/description&gt;
      &lt;/product&gt;
    &lt;/products&gt;
  &lt;/offer&gt;
  </code></pre>
  
  <p>I can <a href="https://stackoverflow.com/questions/3996444/xmllang-parse-in-php">xml:lang parse in PHP</a> by adding exact language code in xpath </p>
  
  <p><code>print_r($xml-&gt;xpath('products/product/description/name[@xml:lang = "eng"]'));</code></p>
  
  <p>But I need to add all xml:lang atributes values to parsed array.</p>
  
  <p>Can it be done with PHP SimpleXML?</p>