1. 3
  1.  

  2. 3

    To get this working, you have to download and compile these files:

    I think its probably better not to try to reinvent the wheel here. For example php-simplexml can handle this just fine. This gives you a workable XML object, and prints it:

    $o_xml = simplexml_load_file('file.xml');
    print_r($o_xml);
    

    or you can use php-json to convert to a plain Map:

    $o_xml = simplexml_load_file('file.xml');
    $s_json = json_encode($o_xml);
    $m_json = json_decode($s_json, true);
    print_r($m_json);