src/Helpers/XMLParser.php
function &getTree()
    {
        // load xml and check if it turns a valid object. TODO: it will throw error.
        /* $xml = simplexml_load_file($this->data);
          if (!$xml) {
          echo 'invalid xml file '.$this->data; exit;
          } */
        //$parser = xml_parser_create('ISO-8859-1');
        $parser = xml_parser_create('');
        xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
        xml_parse_into_struct($parser, $this->data, $vals, $index);
        xml_parser_free($parser);

        $i = -1;
        return $this->getchildren($vals, $i);
    }
function &getTree()
    {
        // load xml and check if it turns a valid object. TODO: it will throw error.
        /* $xml = simplexml_load_file($this->data);
          if (!$xml) {
          echo 'invalid xml file '.$this->data; exit;
          } */
        //$parser = xml_parser_create('ISO-8859-1');
        $parser = xml_parser_create('');
        xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
        xml_parse_into_struct($parser, $this->data, $vals, $index);
        xml_parser_free($parser);

        $i = -1;
        return $this->getchildren($vals, $i);
    }
Then, coerce that into a simple nested array.