You can use
XmlDocument[
^].
XmlDocument xmlDoc = new XmlDocument();
XmlElement elRoot = xmlDoc.CreateElement("body");
xmlDoc.AppendChild(elRoot);
XmlElement elParam = xmlDoc.CreateElement("param");
XmlText elValue = xmlDoc.CreateTextNode("MyClass_SEQ");
elParam.AppendChild(elValue);
elParam.SetAttribute("name", "sequence");
elRoot.AppendChild(elParam);
XmlElement elProp = xmlDoc.CreateElement("property");
elProp.SetAttribute("name", "Prop1");
elProp.SetAttribute("column", "Column1");
elProp.SetAttribute("type", "Int32");
elRoot.AppendChild(elProp);
string s = xmlDoc.OuterXml;
If you can use .NET3.5 or later you can also use
XDocument[
^]
XDocument doc = new XDocument();
XElement xeBody = new XElement("body");
XElement xeParam = new XElement("param", "MyClass_SEQ");
xeParam.Add(new XAttribute("name", "sequence"));
xeBody.Add(xeParam);
XElement xeProperty = new XElement("property");
xeProperty.Add(new XAttribute("name", "Prop1"));
xeProperty.Add(new XAttribute("column", "Column1"));
xeProperty.Add(new XAttribute("type", "Int32"));
xeBody.Add(xeProperty);
doc.Add(xeBody);
doc.Save(@"c:\Temp\test.xml");