public void Save(GffRootStruct root, string path) { Initialize(); _rootStruct = root; FileStream fs; if (File.Exists(path)) { fs = new FileStream(path, FileMode.Truncate); } else { fs = new FileStream(path, FileMode.Create); } Xdoc.AppendChild(Xdoc.CreateXmlDeclaration("1.0", LatinEncoding.Name, "yes")); Write(Xdoc, _rootStruct); Xdoc.Save(fs); fs.Close(); }