- XmlDocument xd = new XmlDocument();
- //添加顶级结点(如果不添加一个节点的话,无法使用xd.DocumentElement.AppendChild,会报出:未将对象引用设置到对象的实例的错误)
- XmlElement xe = xd.CreateElement("XmlDocumentTest");
- xd.AppendChild(xe);
- //第一个XmlDocument:vsXmlDocument1
- XmlNode xnDesi = xd.ImportNode(vsXmlDocument1.DocumentElement, true);
- xd.DocumentElement.AppendChild(xnDesi);
- //第二个XmlDocument:vsXmlDocument2
- XmlNode xnRun = xd.ImportNode(vsXmlDocument2.DocumentElement, true);
- xd.DocumentElement.AppendChild(xnRun);
- xd.Save(filePath);

![[手游] 三网H5小游戏【少年仙路】WIN系服务端+Linux手工服务端+详细搭建教程](https://cdn.jxasp.com:9143/image/20260615/136BC33AA47EB0D84E878835A8B38FDB.png)

















