我使用此代码使用C#类创建xml文件。XmlDocumentdoc=newXmlDocument();XmlNodedocNode=doc.CreateXmlDeclaration("1.0","UTF-8",null);doc.AppendChild(docNode);XmlNodeRootNode=doc.CreateElement("SDF");doc.AppendChild(RootNode);XmlAttributerootAttribute2=doc.CreateAttribute("Version");rootAttribute2.Value="3.0";RootNode