title: Create array out of XML data
body: <p>I have a simple xml object like this as a result of Zend_Rest_Client_Result Object.</p>
  
  <pre><code>&lt;userdetails&gt;
    &lt;name value="jake"/&gt;
    &lt;type value="user"/&gt;
    &lt;attribute name="fname"&gt;
      &lt;value&gt;Jake&lt;/value&gt;
    &lt;/attribute&gt;
    &lt;attribute name="lname"&gt;
      &lt;value&gt;Gordon&lt;/value&gt;
    &lt;/attribute&gt;
    &lt;attribute name="phone"&gt;
      &lt;value&gt;123-555-1234&lt;/value&gt;
      &lt;value&gt;999-888-7777&lt;/value&gt; 
    &lt;/attribute&gt;
   &lt;/userdetails&gt;
  </code></pre>
  
  <p>How can I create an array like this from the above XML object using PHP?</p>
  
  <pre><code> $userDetails = array();
   $userDetails["name"] = "jake";
   $userDetails["type"] = "user";
   $userDetails["fname"] = "Jake";
   $userDetails["lname"] = "Gordon";
   $userDetails["phone"][0] = "123-555-1234";
   $userDetails["phone"][1] = "123-555-1234";
  </code></pre>
  
  <p>Thanks,</p>