<p>I'm serializing to XML my class where one of properties has type List&lt;string&gt;.</p>

<pre><code>public class MyClass {
    ...
    public List&lt;string&gt; Properties { get; set; }
    ...
}
</code></pre>

<p>XML created by serializing this class looks like this:</p>

<pre><code>&lt;MyClass&gt;
    ...
    &lt;Properties&gt;
        &lt;string&gt;somethinghere&lt;/string&gt;
        &lt;string&gt;somethinghere&lt;/string&gt;
    &lt;/Properties&gt;
    ...
&lt;/MyClass&gt;
</code></pre>

<p>and now my question. How can I change my class to achieve XML like this:</p>

<pre><code>&lt;MyClass&gt;
    ...
    &lt;Properties&gt;
        &lt;Property&gt;somethinghere&lt;/Property&gt;
        &lt;Property&gt;somethinghere&lt;/Property&gt;
    &lt;/Properties&gt;
    ...
&lt;/MyClass&gt;
</code></pre>

<p>after serializing. Thanks for any help!</p>

Try
XmlArrayItemAttribute
:
```
```
using System;
using System.IO;
using System.Xml.Serialization;
using System.Collections.Generic;

public class Program
{
    [XmlArrayItem("Property")]
    public List<string> Properties = new List<string>();

    public static void Main(string[] args)
    {
        Program program = new Program();
        program.Properties.Add("test1");
        program.Properties.Add("test2");
        program.Properties.Add("test3");

        XmlSerializer xser = new XmlSerializer(typeof(Program));
        xser.Serialize(new FileStream("test.xml", FileMode.Create), program);
    }
}
```
```
test.xml:
```
```
<?xml version="1.0"?>
<Program xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Properties>
    <Property>test1</Property>
    <Property>test2</Property>
    <Property>test3</Property>
  </Properties>
</Program>
```
```