I want to transform the 'values' array created by xml_parse_into_struct() into a bunch of nested arrays which I can walk recursively. This is for a very simple XML class which will hierarchically search the document like so:
$xml_data = "
<sometag>
<someothertag>
<somedata>foo</somedata>
</someothertag>
<someothertag>
<somedata>bar</somedata>
</someothertag>
</sometag>
<sometag>
<someothertag>
<somedata>baz</somedata>
</someothertag>
</sometag>";
$parser = new Xml_Data($xml_data);
$somedata = $parser->find('sometag')->find('someothertag')->results();
// 0: "somedata"
// "value": "foo"
// 1: "somedata"
// "value": "bar"
// etc.
storing it in nested associative arrays would make it much easier to work with than keeping track of each opening and closing tag and what 'level' they occur at like xml_parse_into_struct
outputs. But I wonder -- if the document gets pretty big, will this huge array be horrible? Should I just give up and traverse the stupid version of the array that PHP gives me?