here is a simple sample.i hope this may help you to get a basic idea.
XmlDocument xmlDoc = new XmlDocument();
XmlNode outputsElement = xmlDoc.CreateElement("outputs");
XmlElement Element = xmlDoc.CreateElement("output");
XmlAttribute nameAtt = xmldoc.CreateAttribute("name");
Element.Attributes.Append(nameAtt);
XmlAttribute valueAtt = xmldoc.CreateAttribute("value");
Element.Attributes.Append(valueAtt);
XmlAttribute typeAtt = xmldoc.CreateAttribute("type");
Element.Attributes.Append(typeAtt);
outputsElement.AppendChild(Element);