title: Parsing complex XML in PHP5
body: <p>Hello this is my first post.
  i'm trying to parse an xml using php, but i'm stuck with it</p>
  
  <p>example of my xml :</p>
  
  <pre><code>&lt;xml xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
       xmlns:rs='urn:schemas-microsoft-com:rowset'
       xmlns:z='#RowsetSchema'&gt;
  &lt;s:Schema id='RowsetSchema'&gt;
     &lt;s:ElementType name='row' content='eltOnly' rs:CommandTimeout='30'&gt;
        &lt;s:AttributeType name='ows_LinkTitle' rs:name='Phone Number*' rs:number='1'&gt;
           &lt;s:datatype dt:type='string' dt:maxLength='512' /&gt;
        &lt;/s:AttributeType&gt;
        &lt;s:AttributeType name='ows_GSM_x0020_PUK' rs:name='GSM PUK' rs:number='2'&gt;
           &lt;s:datatype dt:type='string' dt:maxLength='512' /&gt;
        &lt;/s:AttributeType&gt;
     &lt;/s:ElementType&gt;
  &lt;/s:Schema&gt;
  &lt;rs:data&gt;
     &lt;z:row ows_LinkTitle='628558621183' ows_GSM_x0020_PUK='41016732'/&gt;
     &lt;z:row ows_LinkTitle='628558621181' ows_GSM_x0020_PUK='21783670'/&gt;
  &lt;/rs:data&gt;
  &lt;/xml&gt;
  </code></pre>
  
  <p>i'm trying to get the value from each of 'z:row'
  Any help is very appreciated. Thanks</p>
  
  <p>i'm trying this code and it doesnt work</p>
  
  <pre><code>$xml_all = simplexml_load_string($xmlnya);
  
  echo '&lt;ol&gt;';
  foreach ($xml_all-&gt;xml-&gt;rs-&gt;z as $zrow)
  {
   echo '&lt;li&gt; ows_LinkTitle: '.$zrow['ows_LinkTitle'];
   echo '&lt;/li&gt;';
  }
  echo '&lt;/ol&gt;';
  </code></pre>