XmlElement.ReplaceChild (gb.xml)

Sub ReplaceChild ( OldChild As XmlNode, NewChild As XmlNode )

Replaces the child node OldChild with NewChild in the list of children.

Note that the removed children are destroyed only if you have no reference on them.