{
MemoryStream stream = new MemoryStream();
XmlTextWriter writer = new XmlTextWriter(stream,null);
writer.Formatting = Formatting.Indented;
doc.Save(writer);
StreamReader sr = new StreamReader(stream,System.Text.Encoding.UTF8);
stream.Position = 0;
string xmlString = sr.ReadToEnd();
sr.Close();
stream.Close();
return xmlString.Replace("<?xml version=\"1.0\"?>",""); }
原文链接:https://www.f2er.com/xml/297939.html