public void Write(string filename, ActivityFolder folder, Configuration configuration) { var document = new XmlDocument(); document.AddXmlDeclaration("1.0", "UTF-8", null); document .AddSubElement("kml", "http://www.opengis.net/kml/2.2") .WithXmlns("gx", "http://www.google.com/kml/ext/2.2") .WithXmlns("kml", "http://www.opengis.net/kml/2.2") .WithXmlns("atom", "http://www.w3.org/2005/Atom") .AppendChild(GetFolderNode(document, folder, configuration)) ; document.Save(filename); }