Create an XElement from tag name in CSharp

Description

The following code shows how to create an XElement from tag name.

Example


using System;/*  ww w  .java  2s.  c o  m*/
using System.Linq;
using System.Xml.Linq;

public class MainClass{
   public static void Main(){
   
        XElement el = new XElement("Root");
        Console.WriteLine(el);
   }
}




















Home »
  C# Tutorial »
    XML »




Load Parse
Document
Element
Attribute
Namespace
Query
Save
Schema
Style