I have an XML file and I am loading it in Xmldocument. This document has a node with some child nodes like this\[code\]<xml here> <somenode> <child> </child> <children></children> <children></children> <children></children> // I need to insert it <children></children> // I need to insert this second time <children></children> <children></children> <child> </child> <somenode><xml here>\[/code\]here somenode has some children where first and last children node names are same where as other nodes except the first and last node has some diffrent name ( identical to each other ). I am creating a function to insert a node at specific position, I am not sure about the criteria but may be in the mid.
- how can I insert node in specific position. I am using XMLnode.appendChild method for insertion
- Do I need to rearrange/sort nodes after insertion. Please suggest.
- How can I determine what is structure and how should I find where the new node should be added according to current document structure.