xml的节点默认是不允许修改的,本文也就不做处理了
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(xmlPath);
XmlElement element = (XmlElement)xmlDoc.SelectSingleNode("BookStore/NewBook");
element.SetAttribute("Name", "Zhang");
xmlDoc.Save(xmlPath);