For example
private void button1_Click(object sender, EventArgs e)
{
XmlWriter writer = XmlWriter.Create(@"F:\TEMP\xml.xml");
writer.WriteStartElement("Personel");
writer.WriteStartElement("IT");
writer.WriteAttributeString("Name", textBox1.Text);
writer.WriteElementString("Age", textBox2.Text);
writer.WriteElementString("Occupation", textBox3.Text);
writer.WriteEndElement();
writer.Close();
}
dont forget to include
using System.Xml;