I just analyzed my design work for the past day.
It turns out that I implemented simple two level hierarchy in strings, rather than XML, which is strange for my liking.
I had to implement this: A, where A has children a1, a2, ..., an, B, where B has children b1, b2, ..., bm, C, where ... and so on. Had to save the definition somewhere.
What was the first implementation like?
"A:a1:a2:a3|B:b1:b2:b3:b4:b5|C:c1:c2:c3:c4:c5:c6", where first-level node was always array[0] if I just parsed the string with is-everywhere split() method, passing "|" as the second parameter.
This is how it went:
var firstLevel = split(array, "|");
var secondLevel = split(firstLevel, ":");
var item = secondLevel(j);
Why?
My <insert worship preference>, it is still easier to parse strings than XML in JavaScript.