CSharp examples for XML:XML LINQ
load XML via a textreader using LINQ using StreamReader
using System;/*w w w. j a v a 2 s. com*/ using System.IO; using System.Xml; using System.Xml.Linq; class MainClass { static void Main(string[] args) { string filename = @"ProductCatalog.xml"; Console.WriteLine("Loading using a TextReader"); TextReader reader = new StreamReader(filename); XElement root = XElement.Load(reader); // write out the xml Console.WriteLine(root); } }