using System.Xml.Linq;
//XML example:
//<Lines>
// <Line Id="1">one</Line>
// <Line Id="2">two</Line>
//</Lines>
var filePath = @"\storage\emulated\0\0\data.xml";
var doc = new XDocument(
new XElement("Lines",
new XElement("Line", "one",
new XAttribute("Id", "1")),
new XElement("Line", "two",
new XAttribute("Id", "2"))));
doc.Save(filePath);