Cast XElement to String
using System; using System.Linq; using System.Xml.Linq; using System.Collections.Generic; class Program//from w w w .j a v a 2 s .co m { static void Main(string[] args){ XElement name = new XElement("Name", "Joe"); Console.WriteLine(name); Console.WriteLine((string)name); } }