public static void Main()
XNamespace ss = "urn:schemas-microsoft-com:office:spreadsheet";
var document = new XDocument(
new XDeclaration("1.0", null, null),
new XProcessingInstruction("mso-application", "progid=\"Excel.Sheet\""),
new XElement(ss + "Workbook",
new XAttribute("xmlns", "urn:schemas-microsoft-com:office:spreadsheet"),
new XAttribute(XNamespace.Xmlns + "o", "urn:schemas-microsoft-com:office:office"),
new XAttribute(XNamespace.Xmlns + "x", "urn:schemas-microsoft-com:office:excel"),
new XAttribute(XNamespace.Xmlns + "ss", "urn:schemas-microsoft-com:office:spreadsheet"),
new XAttribute(XNamespace.Xmlns + "html", "http://www.w3.org/TR/REC-html40"),
new XElement(ss + "Styles",
new XElement(ss + "Style",
new XAttribute("ID", "Default")
new XElement(ss + "Worksheet",
new XAttribute(ss + "Name", "Worksheet Name"),
new XElement(ss + "Table",
new XElement(ss + "AutoFitHeight", 0),
new XElement(ss + "Cell",
new XElement(ss + "Data",
new XAttribute(ss + "Type", "String"),
Console.WriteLine(document);