XElement Constructor (System.Xml.Linq) | Microsoft Docs
https://docs.microsoft.com/en-us/dotnet/api/system.xml.linq.xelement.-ctor
XElement xmlTree = new XElement("Root", new XAttribute("Att1", 1), new XElement("Child1", 1), new XElement("Child2", 2) ); // Create a clone of the tree. XElement treeClone = new XElement(xmlTree); Console.WriteLine("xmlTree = treeClone: {0}", XNode.DeepEquals(xmlTree, treeClone)); // Do some work with xmlTree, perhaps pass it to other methods.
DA: 51 PA: 12 MOZ Rank: 59