title: How to make xsd2code create XmlArrayAttribute and XmlArrayItemAttribute without making an extra class
body: <p>I have an xsd that I want to look a certain way serialized. I can achieve what I want with the following but the problem is, xsd2code generates an extra class that's completely unused anywhere. Am I doing it wrong? Is there another trick I am missing?</p>
  
  <pre><code>&lt;xsd:schema 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  elementFormDefault="qualified" &gt;
  
      &lt;xsd:element name="UITranslatorConfiguration" &gt;
          &lt;xsd:complexType&gt;
              &lt;xsd:sequence&gt;
                  &lt;xsd:element ref="Queries" minOccurs="0" /&gt;
              &lt;/xsd:sequence&gt;
          &lt;/xsd:complexType&gt;
      &lt;/xsd:element&gt;
  
      &lt;xsd:element name="Queries"&gt;
          &lt;xsd:complexType&gt;
              &lt;xsd:sequence&gt;
                  &lt;xsd:element ref="Query" minOccurs="0" maxOccurs="unbounded"/&gt;
              &lt;/xsd:sequence&gt;
          &lt;/xsd:complexType&gt;
      &lt;/xsd:element&gt;
  
      &lt;xsd:element name="Query"&gt;
          &lt;xsd:complexType&gt;
              &lt;xsd:simpleContent&gt;
                  &lt;xsd:extension base="xsd:string"&gt;
                      &lt;xsd:attribute name="QueryID" type="xsd:string" /&gt;
                  &lt;/xsd:extension&gt;
              &lt;/xsd:simpleContent&gt;
          &lt;/xsd:complexType&gt;
      &lt;/xsd:element&gt;
  
  &lt;/xsd:schema&gt;
  </code></pre>
  
  <p>xml output I want:</p>
  
  <pre><code>&lt;UITranslatorConfiguration&gt;
      &lt;Queries&gt;
          &lt;Query QueryID="queryID1"&gt;someQueryText&lt;/Query&gt;
          &lt;Query QueryID="queryiq2"&gt;someQueryText2&lt;/Query&gt;
          &lt;Query QueryID="queryiq3"&gt;someQueryText3&lt;/Query&gt;
      &lt;/Queries&gt;
  &lt;UITranslatorConfiguration&gt;
  </code></pre>
  
  <p>The code it generates:</p>
  
  <p>this is fine:</p>
  
  <pre><code>[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.38968")]
  [System.SerializableAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
  [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)]
  public partial class UITranslatorConfiguration {
  
      [EditorBrowsable(EditorBrowsableState.Never)]
      private List&lt;Query&gt; queriesField;
  
      private static System.Xml.Serialization.XmlSerializer serializer;
  
      public UITranslatorConfiguration() {
          this.queriesField = new List&lt;Query&gt;();
      }
  
      [System.Xml.Serialization.XmlArrayAttribute(Order=0)]
      [System.Xml.Serialization.XmlArrayItemAttribute("Query", IsNullable=false)]
      public List&lt;Query&gt; Queries {
          get {
              return this.queriesField;
          }
          set {
              this.queriesField = value;
          }
      }
  }
  </code></pre>
  
  <p>this is fine:</p>
  
  <pre><code>[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.38968")]
  [System.SerializableAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
  [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)]
  public partial class Query {
  
      [EditorBrowsable(EditorBrowsableState.Never)]
      private string queryIDField;
  
      [EditorBrowsable(EditorBrowsableState.Never)]
      private string valueField;
  
      private static System.Xml.Serialization.XmlSerializer serializer;
  
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public string QueryID {
          get {
              return this.queryIDField;
          }
          set {
              this.queryIDField = value;
          }
      }
  
      [System.Xml.Serialization.XmlTextAttribute()]
      public string Value {
          get {
              return this.valueField;
          }
          set {
              this.valueField = value;
          }
      }
  }
  </code></pre>
  
  <p><strong>This is not fine. Where did this come from and why? It's not used anywhere at all. How do I make xsd2code not generate this class.</strong></p>
  
  <pre><code>[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.38968")]
  [System.SerializableAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
  [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)]
  public partial class Queries {
  
      [EditorBrowsable(EditorBrowsableState.Never)]
      private List&lt;Query&gt; queryField;
  
      private static System.Xml.Serialization.XmlSerializer serializer;
  
      public Queries() {
          this.queryField = new List&lt;Query&gt;();
      }
  
      [System.Xml.Serialization.XmlElementAttribute("Query", Order=0)]
      public List&lt;Query&gt; Query {
          get {
              return this.queryField;
          }
          set {
              this.queryField = value;
          }
      }
  }
  </code></pre>