Description

Cast XElement to String

Demo

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);
    }
}

Result

Related Topic