Description

Cast XElement to String

Demo

using System;
using System.Linq;
using System.Xml.Linq;
using System.Collections.Generic;

class Program//from   www.  ja v a 2s.c  o  m
{
    static void Main(string[] args){
         XElement name = new XElement("Name", "Joe");
         Console.WriteLine(name);
         Console.WriteLine((string)name);
    }
}

Result

Related Topic