var objCustomer = new[]
{
new {CustID = 2, CustName = "Test", Phone = "123-123-1236"},
new {CustID = 3, CustName = "Test2", Phone = "123-123-1235"},
};
XElement _customers = new XElement("customers",
from c in objCustomer
orderby c.CustID //descending
select new XElement("customer",
new XElement("name", c.CustName),
new XAttribute("ID", c.CustID),
new XElement("phone", c.Phone)
)
);
Console.WriteLine(_customers);