XElement Constructor (XElement)
Assembly: System.Xml.Linq (in System.Xml.Linq.dll)
The following example creates an XML tree, creates a clone of the tree, and then calls DeepEquals, which tests whether the two XML trees are equal.
StringBuilder output = new StringBuilder(); 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); output.Append("xmlTree = treeClone: " + XNode.DeepEquals(xmlTree, treeClone) + Environment.NewLine); // Do some work with xmlTree, perhaps pass it to other methods. xmlTree.Add(new XElement("Child3", 3)); output.Append("xmlTree = treeClone: " + XNode.DeepEquals(xmlTree, treeClone) + Environment.NewLine); OutputTextBlock.Text = output.ToString();
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.