Create XElement class from another XElement object.
Imports System
Imports System.Xml
Imports System.Xml.XPath
Public Class MainClass
Public Shared Sub Main()
Dim xmlTree As XElement = _
<Root Att1="1">
<Child1>1</Child1>
<Child2>2</Child2>
</Root>
Dim treeClone As XElement = New XElement(xmlTree)
Console.WriteLine("xmlTree = treeClone: {0}", XNode.DeepEquals(xmlTree, treeClone))
xmlTree.Add(New XElement("Child3", 3))
Console.WriteLine("xmlTree = treeClone: {0}", XNode.DeepEquals(xmlTree, treeClone))
End Sub
End Class