Use the System.Xml.Linq namespace for this.

Here is a sample program:

string str = @"
                    <LanguageDetails>
                        <UserNode>
                            <Lang>
                                <![CDATA[en]]>
                            </Lang>
                        </UserNode>
                    </LanguageDetails>";
 
            XDocument xdoc = XDocument.Load(new StringReader(str));
 
            var lang = from d in xdoc.Elements("LanguageDetails")
						.Elements("UserNode")
                       select d;
 
            MessageBox.Show( 
		lang.FirstOrDefault().Element("Lang").Value 
		);
VN:F [1.1.6_502]
Rating: 0.0/5 (0 votes cast)
Share:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • DotNetKicks
  • LinkedIn
  • Live
  • MySpace
  • StumbleUpon
  • Technorati

Related posts:

  1. SQL IN clause in LINQ
  2. Build DateTime from values
  3. Extreme beginner’s LINQ sample in VB.NET
  4. Populate listbox in a thread in .net
  5. What is the difference between CAST and CONVERT in SQL?