带问号的节点不是给你读取用的啊.你为什么要读它?

解决方案 »

  1.   

    貌似只能搞一个;除非你按行读出数据,在第一个之后插入,再写入;
      

  2.   

    那一行叫‘处理指令(processing instruction)‘,可以用XmlProcessingInstruction进行添加:XmlDocument doc = new XmlDocument();var instruction = doc.CreateProcessingInstruction("mso-application", "progid=\"Excel.Sheet\"");
    doc.AppendChild(instruction);doc.AppendChild(doc.CreateElement("something"));
    doc.Save(Console.Out);