Gets the XNamespace object that corresponds to the XML URI (http://www.w3.org/XML/1998/namespace).
using System; using System.IO; using System.Xml; using System.Xml.Linq; using System.Collections; using System.Collections.Generic; public class MainClass{ public static void Main(){ XElement root = new XElement("Root", new XAttribute(XNamespace.Xml + "space", "preserve"), new XElement("Child", "content") ); Console.WriteLine(root); } }