It is easy with LINQ to XML
// create new element
var newElement = new XElement("pair",
new XAttribute("key","111111111111"
new XAttribute("value","222222222222"));
// load the XML Document
var xDoc = XDocument.Load("path");
// Add new element to the root element
xDoc.Root.Add(newElement);
//And save the XML file
xDoc.Save("path")
Note: You need to add a reference to System.Xml.Linq.dll
from your project
And I would recommend you read the LINQ to XML tutorial
for more details.