How do I load an XDocument when the xml is in a string variable?
Asked
Active
Viewed 1.9k times
1 Answers
23
XDocument.Parse(yourvariable)
http://msdn.microsoft.com/en-us/library/system.xml.linq.xdocument.parse.aspx

Mike Gleason jr Couturier
- 9,018
- 4
- 40
- 59
-
I think this only available in .NET 3.5 and higher. – Kevin Kibler Nov 26 '09 at 16:38
-
2If he's using XDocument over XmlDocument, he's already using .NET 3.5 with probably LINQ to XML! – Mike Gleason jr Couturier Nov 26 '09 at 16:46
-
Good point. I misread the question. – Kevin Kibler Nov 26 '09 at 16:58
-
No problem, happens to me all the time :) – Mike Gleason jr Couturier Nov 26 '09 at 18:33