I have a nested, numbered list structure like this:
1.1 - "james"
1.1.1 - "alice"
1.2.1 - "bob"
What is the best/fastest way to turn it into an XML structure like this:
> <1>
> <1><james/>
> <1><alice/></1>
> <2><bob/></2>
> </1>
> </1>
This is super easy if the depth of the numbered lists is only 3, but in this case it is unknown, maybe up to 6. I'm pretty sure I need to create a recursive self-referential function but need a way of putting each element in its place within the XML structure, which I'm stuck on at the moment.