Tag: XDocument

How to Populate XDocument from String in C# ?

To populate the XDocument from a string in C# , we can use the Parse method defined in the XDocument class. Below is a sample code snippet that demonstrates how to populate XDocument from string in C#. How to Populate XDocument from String in C# ?

How to Convert XmlDocument to XDocument in C# ?

If you want to convert an XmlDocument to XDocument in C# , you can use the XmlNodeReader which does the conversion for you. Use the MoveToContent method and load it to the XDocument class. How to Convert XmlDocument to XDocument in C# ?