用程序这样就可以了
XmlDocument oXMLDOM = new XmlDocument();
XmlNode oPiNode = 
oXMLDOM.CreateProcessingInstruction("xml","version='1.0' encoding='gb2312'");
oXMLDOM.AppendChild(oPiNode);
MessageBox.Show(oXMLDOM.OuterXml);