//创建xml文件
XmlDocument xml = new XmlDocument();
//创建元素根
XmlElement root_2 = xml.CreateElement(“note”);
//添加元素
xml.AppendChild(root_2);
//创建属性
//创建属性
XmlAttribute att2 = xml.CreateAttribute(“Jone”);
att2.Value =“hahah”;
root_2.Attributes.SetNamedItem(ATT2);
//创建元素
XmlElement temp = xml.CreateElement(“aaa”);
temp.InnerText =“aaaaaaaaaaaaaaaaaa”;
root_2。
//保存文件
xml.Save(Application.dataPath +“/路径”);
XmlDocument xml = new XmlDocument();
//创建元素根
XmlElement root_2 = xml.CreateElement(“note”);
//添加元素
xml.AppendChild(root_2);
//创建属性
XmlAttribute att = xml.CreateAttribute(“to”);
//给属性赋值
att.Value =“Geroge”;
//添加属性
root_2.Attributes.SetNamedItem(ATT);//创建属性
XmlAttribute att2 = xml.CreateAttribute(“Jone”);
att2.Value =“hahah”;
root_2.Attributes.SetNamedItem(ATT2);
//创建元素
XmlElement temp = xml.CreateElement(“aaa”);
temp.InnerText =“aaaaaaaaaaaaaaaaaa”;
root_2。
//保存文件
xml.Save(Application.dataPath +“/路径”);