Change according to your need. You can see the namespace is added with : in the output.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
namespace ConsoleApplication6
{
class Program
{
static void Main(string[] args)
{
XNamespace gml = "http://www.samplens.com";
XElement x = new XElement(gml + "Box", new XAttribute(XNamespace.Xmlns + "gml", gml.NamespaceName), new XElement(gml + "coord","some content" ));
Console.WriteLine(x);
Console.ReadLine();
}
}
}