This method removes the specified node from the list of children and returns it.
XML:
<names>
<name>Alice</name>
<name>Bert</name>
<name>Charlie</name>
<name>Diane</name>
<name>Eric</name>
</names>
VBScript:
Set objXMLDoc = CreateObject("Microsoft.XMLDOM")
objXMLDoc.async = False
objXMLDoc.load("names.xml")
Set objRoot = objXMLDoc.documentElement
Set objExNode = objRoot.removeChild(objRoot.childNodes.item(2))
objRoot.appendChild(objExNode)
Set objNodeList = objXMLDoc.getElementsByTagName("name")
For Each elem in objNodeList
document.write(elem.firstChild.nodeValue & "<br>")
Next
Alice
Bert
Diane
Eric
Charlie
Using the 'names.xml' file this example removes the third 'name' element (Charlie) from the NodeList of the root element's children and appends it to the end. The code then iterates through the Node collection displaying the value of the first child (the text node) of each.