A simpler way to transform the result into an array (requires json module).
<?php
function object2array($object) { return @json_decode(@json_encode($object),1); }
?>
Example:
<?php
$xml_object=simplexml_load_string('<SOME XML DATA');
$xml_array=object2array($xml_object);
?>