Mega Code Archive

 
Categories / C# Book / 05 LINQ XML
 

0531 Use XElement to parse an Xml string

using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Xml.Linq; class Program { static void Main() { string xml = @"<Root><client enabled='false'><timeout>60</timeout></client></Root>"; XElement customer = XElement.Parse(xml); } }