using System; using System.Xml; // Console Application class XMLSample { static void Main() { XmlDocument oXml = new XmlDocument(); XmlElement oRoot = oXml.CreateElement("RootNode"); oXml.AppendChild(oRoot); for(int i=1;i<10;i++) { XmlElement oChild = oXml.CreateElement("ChildNode"); oChild.InnerText = "The text between the tags"; oRoot.AppendChild(oChild); } Console.WriteLine(oRoot.OuterXml); } }