Today i have faced a situation that have to load xml string to XDocument.
But the Load method of XDocument doesn't support the string as a input parameter.
XDocument has another method called XDocument.Parse(xml), this method will accept xml string and parse them into an XDocument.
Example
But the Load method of XDocument doesn't support the string as a input parameter.
XDocument has another method called XDocument.Parse(xml), this method will accept xml string and parse them into an XDocument.
Example
string xmlString=
@"<Root>
<ChildNode1>Value 1</Child>
<ChildNode2>Value 2</Child>
<ChildNode3>Value 3</Child>
</Root>";
XDocument xdocObj= XDocument.Parse(xmlString);
Console.WriteLine(xdocObj);
Hope this note sorted out your search on this issue.