See the attached code for an example.
Basically, you must loop through the array elements, create a
node for each element, and do the same for the nested array. You
can keep that structure in the xml by adding the nested elements as
childnodes to the first node. I used "super" for the first array's
elements and "sub" for the elements contained in that element.
If you need more details just tell.