public XmlDocument GetData(NameValueCollection TagParameter) { XmlDocument xdoc = new XmlDocument(); xdoc.LoadXml("<?xml version=\"1.0\" encoding=\"utf-8\"?><tag />"); XmlNode rootNode = xdoc.SelectSingleNode("/tag"); SecondhandProductBll bll = new SecondhandProductBll(); DataTable dt = bll.GetTopHotList(10); foreach (DataRow row in dt.Rows) { XmlNode DealListNode = XmlUtility.AddNewNode(rootNode, "deal", null); XmlUtility.AddNewNode(DealListNode, "pid", row["seproductid"].ToString()); XmlUtility.AddNewNode(DealListNode, "productname", row["seproductname"].ToString()); } return xdoc; }