Populate XDocument from String

You can use XDocument.Parse for this.


You can use XDocument.Parse(string) instead of Load(string).


How about this...?

TextReader tr = new StringReader("<Root>Content</Root>");
XDocument doc = XDocument.Load(tr);
Console.WriteLine(doc);

This was taken from the MSDN docs for XDocument.Load, found here...

http://msdn.microsoft.com/en-us/library/bb299692.aspx


Try the Parse method.