DataSet dts = new DataSet();
dts.Tables.Add(dt);
TextWriter tw = new StringWriter();
XmlTextWriter xtw = new XmlTextWriter(tw);
dts.WriteXml(xtw, XmlWriteMode.IgnoreSchema);
stXML = tw.ToString(); //string XML Contains the XML Content
xtw.Close();
tw.Dispose();

Abhishek KumarRank #510 · 4.8K reputationPosted Sep 10, 2014, 6:30 AM EDT
what problem are you facing , could you please elaborate.
Abhishek