using System;
using System.Linq;
using System.Xml.Linq;
class LinqToXml
{
static void Main(string[] args)
{
XElement doc = XElement.Load("table.xml");
var products = from prodname in doc.Descendants("products") select prodname.Value;
foreach (var prodname in products)
Console.WriteLine("Product's Detail = {0}\t", prodname);
}
}
|