The following code produces this output:
Allow me answer my own question, this seems to work:
private static string BuildXmlWithLINQ()
{
XDocument xdoc = new XDocument
(
new XDeclaration("1.0", "utf-8", "yes"),
new XElement("customers",
new XElement("customer",
new XElement("firstName", "Jim"),
new XElement("lastName", "Smith")
)
)
);
return xdoc.Declaration.ToString() + Environment.NewLine + xdoc.ToString();
}