title: parse an XML with SimpleXML which has multiple namespaces
body: <p>I have this ugly XML which has alot of namespaces on it, when I try to load it with simpleXML if i indicate the first namespace I'd get an xml object ,but following tags with other namespaces would not make it to the object. </p>
  
  <p>How can I parse this XML ?</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"&gt;
      &lt;soap-env:Header&gt;
          &lt;eb:MessageHeader xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" eb:version="1.0" soap-env:mustUnderstand="1"&gt;
              &lt;eb:From&gt;
                  &lt;eb:PartyId eb:type="URI"&gt;wscompany.com&lt;/eb:PartyId&gt;
              &lt;/eb:From&gt;
              &lt;eb:To&gt;
                  &lt;eb:PartyId eb:type="URI"&gt;mysite.com&lt;/eb:PartyId&gt;
              &lt;/eb:To&gt;
              &lt;eb:CPAId&gt;something&lt;/eb:CPAId&gt;
              &lt;eb:ConversationId&gt;moredata.com&lt;/eb:ConversationId&gt;
              &lt;eb:Service eb:type="compXML"&gt;theservice&lt;/eb:Service&gt;
              &lt;eb:Action&gt;theaction&lt;/eb:Action&gt;
              &lt;eb:MessageData&gt;
                  &lt;eb:MessageId&gt;a certain messageid&lt;/eb:MessageId&gt;
                  &lt;eb:Timestamp&gt;2009-04-11T18:43:58&lt;/eb:Timestamp&gt;
                  &lt;eb:RefToMessageId&gt;mid:areference&lt;/eb:RefToMessageId&gt;
              &lt;/eb:MessageData&gt;
          &lt;/eb:MessageHeader&gt;
          &lt;wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext"&gt;
              &lt;wsse:BinarySecurityToken valueType="String" EncodingType="wsse:Base64Binary"&gt;an impresive binary security toekn&lt;/wsse:BinarySecurityToken&gt;
          &lt;/wsse:Security&gt;
      &lt;/soap-env:Header&gt;
      &lt;soap-env:Body&gt;
          &lt;SessionCreateRS xmlns="http://www.opentravel.org/OTA/2002/11" version="1" status="Approved"&gt;
              &lt;ConversationId&gt;the goodbye token&lt;/ConversationId&gt;
          &lt;/SessionCreateRS&gt;
      &lt;/soap-env:Body&gt;
  &lt;/soap-env:Envelope&gt;
  </code></pre>
  
  <p>im trying to parse it with the following code</p>
  
  <pre><code>&lt;?php
  $xml = simplexml_load_string($res,NULL,NULL,"http://schemas.xmlsoap.org/soap/envelope/");
  ?&gt;
  </code></pre>
  
  <p>but the $xml object would only contain the following</p>
  
  <pre><code>SimpleXMLElement Object
  (
      [Header] =&gt; SimpleXMLElement Object
          (
          )
  
      [Body] =&gt; SimpleXMLElement Object
          (
          )
  
  )
  </code></pre>