private static function _toArray($data, $recursion = false)
    {
        $tmp  = array();
        $data = (array) $data;
        foreach ($data as $k => $v) {
            $v = (array) $v;
            if (isset($v[0]) && is_string($v[0])) {
                $tmp[$k] = $v[0];
            } else {
                $tmp[$k] = self::_toArray($v, true);
            }
        }
        return $tmp;
    }
private static function _toArray($data, $recursion = false)
    {
        $tmp  = array();
        $data = (array) $data;
        foreach ($data as $k => $v) {
            $v = (array) $v;
            if (isset($v[0]) && is_string($v[0])) {
                $tmp[$k] = $v[0];
            } else {
                $tmp[$k] = self::_toArray($v, true);
            }
        }
        return $tmp;
    }
private static function _toArray ( $ data , $ recursion = false ) { $ tmp = array ( ) ; $ data = ( array ) $ data ; foreach ( $ data as $ k => $ v ) { $ v = ( array ) $ v ; if ( isset ( $ v [ 0 ] ) && is_string ( $ v [ 0 ] ) ) { $ tmp [ $ k ] = $ v [ 0 ] ; } else { $ tmp [ $ k ] = self :: _toArray ( $ v , true ) ; } } return $ tmp ; }
SimpleXMLElement to array

@ignore
SimpleXMLElement to array