this function parse a xml simpleXML recursive to array recursive
function SimpleXML2Array($xml){
$array = (array)$xml;
//recursive Parser
foreach ($array as $key => $value){
if(strpos(get_class($value),"SimpleXML")!==false){
$array[$key] = SimpleXML2Array($value);
}
}
return $array;
}