C# Xml
XmlDocument document = new XmlDocument(); //create the xmldocument
document.Load(xmlpath); //load xml by the absoult path
XmlNodeList nodeList = document.GetElementsByTagName("nodetagname"); //get the nodelist of nodetagname
XmlElement element = document.CreateElement("newnodename"); //create node
element.SetAttribute("attributename", "attributevalue"); //set attribute
nodeList[0].AppendChild(element); //add the node to nodeList[0]
浙公网安备 33010602011771号