Simple XML parsing

Xml File
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>originTransactionIDname>
<value><string>102511650088881951string>value>
member>
<member>
<name>responseCodename>
<value><i4>100i4>value>
member>
struct>
value>
param>
params> 

methodResponse>”

PHP :
$xml = new SimpleXMLElement($xml);
$items = $xml->xpath(‘/methodResponse/fault/value/struct/member/name’);
                $firstArr=$this->objectsIntoArray($items[0]);//convert XML Object to Php Array

function objectsIntoArray($arrObjData, $arrSkipIndices = array())
{
$arrData = array();
// if input is object, convert into array
if (is_object($arrObjData)) {
$arrObjData = get_object_vars($arrObjData);
}

if (is_array($arrObjData)) {
foreach ($arrObjData as $index => $value) {
if (is_object($value) || is_array($value)) {
$value = objectsIntoArray($value, $arrSkipIndices); // recursive call
}
if (in_array($index, $arrSkipIndices)) {
continue;
}
$arrData[$index] = $value;
}
}
return $arrData;
}