I'm trying to parse the XML below so that I wind up with an array that looks like the sample included... I'm having a hard time figuring out how to get the attributes inside of the tags to output the way I want it to...
The XML
<cust rid="999999" memberid="12345" lname="Doe" fname="John">
<address memberid="12345" address1="1234 Mockingbird Lane" address2="" city="Oakland" state="CA" zip="91111" country="United States"/>
<phone memberid="12345" phonenumber="415.555.1212" countrycodeid="1" phonetype="Mobile"/>
<custcode memberid="12345" ccode="Silver" deleted=”1”/>
<custcode memberid="12345" ccode="Gold"/>
</cust>
The Array I want :: Note the added array elements
Array
[cust] => Array
[rid] => 999999
[member_id] => 12345
[lname] => Doe
[fname] => John
[address] => Array
[0] => Array
[memberid] => 12345
[address1] => 1234 Mockingbird Lane
[address2] =>
[city] => Oakland
[state] => CA
[zip] => 91111
[country] => United States
[phone] => Array
[0] => Array
[memberid] => 12345
[phonenumber] => 415.555.1212
[countrycodeid] => 1
[phonetype] => Mobile
[custcode] => Array
[0] => Array
[memberid] => 12345
[ccode] => Silver
[deleted] => 1
[1] => Array
[memberid] => 12345
[ccode] => Gold