XDocument xdoc = XDocument.Load("SavedData.xml"); xdoc.Add(new XElement(new XCData(textbox1.text).ToString(),textbox2.text));