using System.Collections.Generic;
public static void Main()
List<string> list = new List<string> { "A", "B", "C" };
List<string> list2 = new List<string> { "1", "2", "3" };
new XDocument(new XDeclaration("1.0", "UTF-8", "yes"),
new XElement("SENDREQUEST",
new XElement("ADID", "UID"),
new XElement("APPLICATIONID", new XAttribute("Type","AN"), "申請案號"),
new XElement("PROSPECTID", "代碼"),
new XElement("SENDTO", list.Select(m => new XElement("TO", m))),
new XElement("SENDFILE", list2.Select(n => new XElement("FILENAME", n))),
new XElement("DATA1", "Subject"),
new XElement("DATA2", "Body")
string xml = xDocument.ToString();