3

When I write out this to the console, the output is missing the XDeclaration content. What gives?

        var map = new XDocument(
            new XDeclaration("1.0", "UTF-8", null),
            new XElement(SiteMap.Namespace + "urlset")
        );

        Console.Write(map.ToString());

How do I get the XML for map including the <?xml...> declaration?

  • This was previously answered. http://stackoverflow.com/questions/957124/how-to-print-xml-version1-0-using-xdocument – Ben.Vineyard May 03 '10 at 23:07

0 Answers0