I have created xml with XElement, but when I display this on an aspx page the format is not what I would like which is:

![enter image description here](https://i.stack.imgur.com/9D3fY.jpg)

c# code:

```
var persons = new[] {
    new Person {
        Name = "Patrick Hines",
        PhoneNumbers = new[] { "206-555-0144", "425-555-0145" }
    },
    new Person {
        Name = "Gretchen Rivas",
        PhoneNumbers = new[] { "206-555-0163" }
    }
};

XElement contacts = new XElement("contacts",
                        from p in persons
                        select new XElement("contact",
                             new XElement("name", p.Name),
                                 from ph in p.PhoneNumbers
                                 select new XElement("phone", ph)
                              ));

            Response.Write(contacts);

```

> 
> 
> ```
> class Person
> {
>     public string Name;
>     public string[] PhoneNumbers;
> }
> 
> ```
> 
>