try any one
Method 1 :
DataSet ds = new DataSet();
DataTable dtControls = new DataTable();
dtControls.Columns.Add("txtBox1Value");
dtControls.Columns.Add("txtBox2Value");
dtControls.Columns.Add("richTextBox1Value");
dtControls.Columns.Add("richTextBox2Value");
DataRow row = dtControls.NewRow();
row["txtBox1Value"] = txtBox1Value.Text;
row["txtBox2Value"] = txtBox2Value.Text;
row["richTextBox1Value"] = richTextBox1Value.Text;
row["richTextBox2Value"] = richTextBox2Value.Text;
dtControls.Rows.Add(row);
ds.Tables.Add(dtControls);
ds.WriteXml("< Path to the xml file>");
note: you shall add this table to the existing dataset to append the data, or you can create a new file.
Method 2
write class properties to XML File [
^]