string path = @”c:\users\administrator\desktop\无人智能便利店\install\收银端\xmlrfi.xml”;
xmldocument xmldoc = new xmldocument();//新建xml文件
xmldoc.load(path);//加载xml文件
xmlnode xm = xmldoc.selectsinglenode(“rfi”);
xmlelement xelkey = xmldoc.createelement(“rfiid”);
xmlattribute xeltype = xmldoc.createattribute(“type”);
xeltype.innertext = “data”;
xelkey.setattributenode(xeltype);
xmlelement xelauthor = xmldoc.createelement(“author”);
xelkey.innertext = “dfdsa”;
xm.appendchild(xelkey);
xmldoc.save(path);