Check out example codes for "c# xml file builder". It will help you in understanding the concepts better.
Code Example 1
Console.WriteLine(
new XElement("Foo",
new XAttribute("Bar", "some & value"),
new XElement("Nested", "data")));
Learn ReactJs, React Native from akashmittal.com