转载自:https://blog.csdn.net/ghlfllz/article/details/8096660
XmlDocument doc=new XmlDocument();
doc.Load( "yourfile.xml ");
//查找节点
XmlNode node=doc.SelectSingleNode( "//TreeNode[@Text= '借阅图书 '] ");
if(node!=null) //找到节点
{
//添加子节点
XmlElement ele=doc.CreateElement( "ChildNode ");
ele.InnerText= "child ";
node.AppendChild(ele);
}
doc.Save( "result.xml ");