Question: I get an XML type data, such as this;

```
<Response>
  <Clients>
    <Client>
      <ID>1</ID>
      <Name>John</Name>
      <Age>25</Age>
      <Address>Some address</Address>
    </Client>
    <Client>
      <ID>2</ID>
      <Name>Mark</Name>
      <Age>22</Age>
      <Address>Some address2</Address>
    </Client>
    <Client>
      <ID>3</ID>
      <Name>Phil</Name>
      <Age>30</Age>
      <Address>Some address3</Address>
    </Client>
  </Clients>
</Response>

```

In C# I have the following code:

```
[XmlRoot("Response")]
public class MyClients
{
    [XmlElement("Clients", typeof(MyClient))]
    public List<MyClient> Clients { get; set; }
}

public class MyClient
{
    [XmlElement("ID")]
    public int ID;

    [XmlElement("Name")]
    public string Name;

    [XmlElement("Age")]
    public int Age;

    [XmlElement("Address")]
    public string Address;
}

```

and I try to get this data, using

```
public ActionResult GetClients()
{
    HttpWebRequest request = (HttpWebRequest)WebRequest.Create("someUrl");
    HttpWebResponse response = (HttpWebResponse)request.GetResponse();
    XmlSerializer serializer = new XmlSerializer(typeof(WFMClientsList));
    Stream receiveStream = response.GetResponseStream();
    WFMClientsList clients = (MyClients)serializer.Deserialize(receiveStream);
}

```

but I get nothing in response.

Can anyone explain how to deserialize XML to `List<MyClient>` correctly?

Answer: 
this is wrong `XmlSerializer serializer = new XmlSerializer(typeof(WFMClientsList));`
must be `XmlSerializer serializer = new XmlSerializer(typeof(MyClients));`

you lost attribute of class `MyClient`
```
  public static T DeserializeObject<T>(string xml)
        {
            XmlSerializer xs = new XmlSerializer(typeof(T));
            MemoryStream memoryStream = new MemoryStream(StringToUTF8ByteArray(xml));
            XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.UTF8);
            return (T)xs.Deserialize(memoryStream);
        }

private static Byte[] StringToUTF8ByteArray(string pXmlString)
        {
            UTF8Encoding encoding = new UTF8Encoding();
            byte[] byteArray = encoding.GetBytes(pXmlString);
            return byteArray;
        }

```