tags:

views:

223

answers:

1

How do I load an XDocument when the xml is in a string variable?

+10  A: 

XDocument.Parse(yourvariable)

http://msdn.microsoft.com/en-us/library/system.xml.linq.xdocument.parse.aspx

Mike Gleason jr Couturier
I think this only available in .NET 3.5 and higher.
CodeSavvyGeek
If he's using XDocument over XmlDocument, he's already using .NET 3.5 with probably LINQ to XML!
Mike Gleason jr Couturier
Good point. I misread the question.
CodeSavvyGeek
No problem, happens to me all the time :)
Mike Gleason jr Couturier