var xml =
new XElement("PULSE", new XAttribute("version", "2.0"),
new XElement("TIME_STAMP", new XAttribute("value", "val"), new XAttribute("timezone", "val")),
new XElement("CARD", new XAttribute("type", "val"), new XAttribute("version", "val")),
new XElement("INFORMATION",
new XElement("GENERAL", new XAttribute("key", "val"), new XAttribute("value", "val"))),
new XElement("DATA_PACKET", new XAttribute("time_offset", "val"),
from x in new Dictionary<string, string> {["1"] = "1", ["2"] = "2", ["3"] = "3" }
select new XElement("DATA", new XAttribute("key", x.Key), new XAttribute("value", x.Value))));