private DataSet ConvertXMLToDataSet(string xmlData) { StringReader stream = null; XmlTextReader reader = null; DataSet xmlDs = new DataSet(); try { XmlDocument xmld = new XmlDocument(); xmld.LoadXml(xmlData); stream = new StringReader(xmld.OuterXml); //从stream装载到XmlTextReader reader = new XmlTextReader(stream); xmlDs.ReadXml(reader); } catch (Exception ex) { WriteTxt(ex.Message + ex.StackTrace, "ConvertXMLToDataSet.txt"); //throw; } return xmlDs; }