title: C# Serialization Remove attribute name from result
body: <p>I'm not able to remove the name of the Attribute <strong>Values</strong> in <strong>clsProduct</strong> from my xml. I tried using <code>[XmlElement(ElementName = "Values", Type = typeof(clsValues)]</code> for my <code>List&lt;clsValues&gt;</code> but it didn't give me the result I need.</p>
  
  <p>You can see the result I need below.</p>
  
  <p>Parts of my serialization class:</p>
  
  <pre><code>[Serializable]
  public class clsProduct
  {
      [XmlAttribute("ID")]
      public string ID { get; set; }
  
      [XmlAttribute("UserTypeID")]
      public string UserTypeID { get; set; }
  
      [XmlArrayItem(ElementName = "Values", Type = typeof(clsValues))]
      public List&lt;clsValues&gt; Values { get; set; }
  
  }
  
  [Serializable]
  public class clsValues
  {
      [XmlElement(ElementName = "Value")]
      public clsValue Value { get; set; }
  
      [XmlArray(ElementName = "MultiValue"),
      XmlArrayItem(ElementName = "Value")]
      public List&lt;clsValue&gt; MultiValue { get; set; }
  }
  
  [Serializable]
  public class clsValue
  {
      [XmlAttribute("AttributeID")]
      public string AttributeID { get; set; }
  
      [XmlText]
      public string Value { get; set; }
  }
  </code></pre>
  
  <p>My current xml result:</p>
  
  <pre><code>&lt;Product ID="PROD-01111010" UserTypeID="Product"&gt;
     &lt;Values&gt;
       &lt;Values&gt;
          &lt;Value AttributeID="ATTR-7196"&gt;201607280755&lt;/Value&gt;
       &lt;/Values&gt;
       &lt;Values&gt;
          &lt;Value AttributeID="ATTR-6236"&gt;PTFE 125 + 25% GF, Platte&lt;/Value&gt;
       &lt;/Values&gt;
       &lt;Values&gt;
          &lt;MultiValue&gt;
              &lt;Value&gt;PLATTE&lt;/Value&gt;
              &lt;Value&gt;LUBRIFLON 225&lt;/Value&gt;
              &lt;Value&gt;PLAQUE&lt;/Value&gt;
              &lt;Value&gt;LUBRIFLON 22&lt;/Value&gt;
          &lt;/MultiValue&gt;
       &lt;/Values&gt;
    &lt;/Values&gt;
  &lt;/Product&gt;
  </code></pre>
  
  <p>Result I need:</p>
  
  <pre><code>&lt;Product ID="PROD-01111010" UserTypeID="Product"&gt;
    &lt;Values&gt;
       &lt;Value AttributeID="ATTR-7196"&gt;201607280755&lt;/Value&gt;
       &lt;Value AttributeID="ATTR-6236"&gt;PTFE 125 + 25% GF, Platte&lt;/Value&gt;
       &lt;MultiValue&gt;
          &lt;Value&gt;PLATTE&lt;/Value&gt;
          &lt;Value&gt;LUBRIFLON 225&lt;/Value&gt;
          &lt;Value&gt;PLAQUE&lt;/Value&gt;
          &lt;Value&gt;LUBRIFLON 22&lt;/Value&gt;
       &lt;/MultiValue&gt;
     &lt;/Values&gt;
   &lt;/Product&gt;
  </code></pre>
  
  <p>Can someone help? </p>
  
  <p>Thanks</p>
  
  <p>Edit: 
  When I'm using</p>
  
  <p><code>[XmlElement(ElementName = "Values", Type = typeof(clsValues))]
   public List&lt;clsValues&gt; Values { get; set; }</code> </p>
  
  <p>instead of <code>XmlArrayItem</code> I get this result:</p>
  
  <pre><code>&lt;Product ID="PROD-01111010" UserTypeID="Product"&gt;
       &lt;Values&gt;
          &lt;Value AttributeID="ATTR-7196"&gt;201607280755&lt;/Value&gt;
       &lt;/Values&gt;
       &lt;Values&gt;
          &lt;Value AttributeID="ATTR-6236"&gt;PTFE 125 + 25% GF, Platte&lt;/Value&gt;
       &lt;/Values&gt;
       &lt;Values&gt;
          &lt;MultiValue&gt;
              &lt;Value&gt;PLATTE&lt;/Value&gt;
              &lt;Value&gt;LUBRIFLON 225&lt;/Value&gt;
              &lt;Value&gt;PLAQUE&lt;/Value&gt;
              &lt;Value&gt;LUBRIFLON 22&lt;/Value&gt;
          &lt;/MultiValue&gt;
       &lt;/Values&gt;
  &lt;/Product&gt;
  </code></pre>