62,269
社区成员
发帖
与我相关
我的任务
分享using System;
using System.IO;
using System.Xml;
public class Sample {
public static void Main() {
XmlDocument doc = new XmlDocument();
doc.LoadXml("<book genre='novel' ISBN='1-861001-57-5'>" +
"<title>Pride And Prejudice</title>" +
"</book>");
XmlNode root = doc.DocumentElement;
//Remove the title element.
root.RemoveChild(root.FirstChild);
Console.WriteLine("Display the modified XML...");
doc.Save(Console.Out);
}
}