public void Save() { List <XmlNode> unknownSections = GetUnknownSections(); XmlDocument doc = new XmlDocument(); XmlNode rootNode = doc.CreateElement(_rootSectionName); doc.AppendChild(rootNode); doc.Save(_fileName); foreach (KeyValuePair <String, ProgramConfiguration> kvp in _configurations) { // XmlNode sectionNode = doc.AddSubNode(kvp.Key); XmlNode subNode = KanoopSerializableObject.Serialize(kvp.Value, doc.DocumentElement); // sectionNode.AddSubNode(subNode); // doc.AddSubNode(subNode); } foreach (XmlNode node in unknownSections) { doc.AddSubNode(node); } doc.Save(_fileName); }