XmlDocument xml = new XmlDocument();
XmlElement root = xml.CreateElement("ROOT");
xml.AppendChild(root);
root.AppendChild(xml.Creat
root.SelectSingleNode("Fir
root.AppendChild(xml.Creat
root.SelectSingleNode("Sec
root.SelectSingleNode("Fir
root.SelectSingleNode("Sec
String xmlString = xml.OuterXml;
this might not be the best way.. but i like it :)
Main Topics
Browse All Topics





by: yasser_helmyPosted on 2004-12-15 at 06:37:25ID: 12830186
You have some choices based on your requirements..
XmlDocument is good.. you can create a document, add nodes and change their values.. use the OuterXml property to get the string representation of the xml.. or use Save() to save it into a file or an XmlWriter..
using XmlWriter, you can add tags one by one..
you can also use a dataset and fill it with data.. this is useful for fixed format xml..
i recommend XmlDocument as i use it a lot..
hope this helps :)