XElement.Load (TextReader) loads an XElement from a TextReader.
using System; using System.IO; using System.Linq; using System.Xml.Linq; using System.Collections; using System.Collections.Generic;
public class MainClass
{ public static void Main()
{
TextReader sr = new StringReader("<Root><Child/></Root>");
XElement xmlTree = XElement.Load(sr);
sr.Close();
Console.WriteLine(xmlTree);
}
}