XElement xml = new XElement("contacts", new XElement("contact", new XAttribute("contactId", "1"), new XElement("firstName", "Barry"), new XElement("lastName", "Gottshall")),
new XElement("contact", new XAttribute("contactId", "2"), new XElement("firstName", "Armando"), new XElement("lastName", "Valdes")));
Console.WriteLine(xml);
Console.ReadLine();