using System.Collections;
using System.Collections.Generic;
public static void Main(string[] args)
var lst = new List<Assinante>(){new Assinante
var html = new XElement("div", new XAttribute("class","dynamic-content"),
from i in lst.GroupBy(x=>new{x.City,x.ClientCode,x.Num}) select
new XElement("div",new XAttribute("class","city"),
new XElement("h1",new XAttribute("class","city-name"), i.Key.City ),
from k in i.GroupBy(a=>a.ClientCode) select
new XAttribute("class","client-code"), k.Key,
from j in k.GroupBy(a=>a.Num) select
new XAttribute("class","client-num"), j.Key ,
new XElement("ul", new XAttribute("class","phone-numbers"),
new XElement("li", new XAttribute("class","phone-number"), l.Phone)