Is there a easy way in PHP to decode the XML that comes back from a SOAP request into reference arrays ?
Code:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><context xmlns="urn:zimbra"><change token="12345"/></context></soap:Header><soap:Body><SearchResponse more="0" sortBy="dateDesc" offset="0" xmlns="urn:zimbraMail"><cn fileAsStr="Contact, Test" id="206622" rev="558980" d="1272466487000" sf="1272466487000" l="7"><a n="lastName">Contact</a><a n="company">A Nice Company</a><a n="workPhone">12345</a><a n="firstName">Test</a><a n="jobTitle">Some Fun Job</a></cn></SearchResponse></soap:Body></soap:Envelope>
Using a PHP function I found it turns the above SOAP XML response into the following array which is pretty hard to work on
Code:
Array
(
    [a] => Array
        (
            [0] => Contact
            [1] => A Nice Company
            [0_attr] => Array
                (
                    [n] => lastName
                )

            [1_attr] => Array
                (
                    [n] => company
                )

            [2] => 12345
            [2_attr] => Array
                (
                    [n] => workPhone
                )

            [3] => Test
            [3_attr] => Array
                (
                    [n] => firstName
                )

            [4] => Some Fun Job
            [4_attr] => Array
                (
                    [n] => jobTitle
                )

        )

)
Any pointers would be gratefully appreciated; even if the response is switch to JSON instead of XML.