ОК. Это мое решение проблемы, в моем xml нет одного и того же имени узла дважды (поэтому каждый должен вносить свои изменения, но основная идея одна и та же
Sub btnc_click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnc.Click
Dim xmldoc As XmlDocument = New XmlDocument()
xmldoc.Load(Server.MapPath("yuor xml path"))
Dim nodee As XmlNodeList = xmldoc.GetElementsByTagName(tempstr)//path to node
' parent element of the element we want to replace
Dim parentElement As XmlNode = nodee(0).ParentNode
' element we want to replace
Dim oldXmlNode As XmlNode = nodee(0)
' new element
Dim newXmlElement As XmlElement = xmldoc.CreateElement(txtdes.Value)
Dim temp As XmlAttribute = oldXmlNode.Attributes("id")//adding attirbute old->new
newXmlElement.Attributes.Append(temp)
Dim node As XmlNode = oldXmlNode.FirstChild node
buildtree(newXmlElement, xmldoc, node)//copy first child to new
node = node.NextSibling /taking next Sibling
While Not IsNothing(node)//while node has brothers
buildtree(newXmlElement, xmldoc, node)/copy Sibling old->new
node = node.NextSibling //next Sibling
End While
parentElement.ReplaceChild(newXmlElement, oldXmlNode)// making the switch
xmldoc.Save(Server.MapPath("path"))
End Sub
Sub buildtree(ByVal newnode As XmlNode, ByVal xmldoc As XmlDocument, ByVal oldxmlnode As XmlNode)
newnode.AppendChild(xmldoc.ImportNode(oldxmlnode, True))
End Sub