How to convert from string to XElement object How to convert from string to XElement object xml xml

How to convert from string to XElement object


Use XElement.Parse method like below

XElement xmlTree = XElement.Parse("<Root><Child>Hey</Child></Root>");Console.WriteLine(xmlTree);