I have very simple XML in a string that I\'m trying to load via XDocument
so that I can use LINQ to XML:
var xmlString = @\"
Use this for XML String
XDocument reader;
using (StringReader s = new StringReader(**XmlResult**))
{
reader = XDocument.Load(s);
}
You are looking for XDocument.Parse
- XDocument.Load
is for files not xml strings:
var doc = XDocument.Parse(xmlString);
Use
var doc = XDocument.Parse(xmlString);