How to convert XElement to XDocument December 3, 2023 by Tarik Just pass the XElement to the constructor of XDocument: var xdoc = new XDocument(new XElement("a", "b"));