title: The same element name with different attributes
body: <p>Is it possible in XSD to have the same elements with different attributes?</p>
  
  <p>I tried something like this:</p>
  
  <pre><code>&lt;xsd:complexType name="Type1"&gt;
      &lt;xsd:attribute name="id" type="xsd:integer" use="required"/&gt;
      &lt;xsd:attribute name="attribute1" type="xsd:integer" use="required"/&gt;
  &lt;/xsd:complexType&gt;
  
  &lt;xsd:complexType name="Type2"&gt;
      &lt;xsd:attribute name="id" type="xsd:integer" use="required"/&gt;
      &lt;xsd:attribute name="attribute2" type="xsd:string" use="optional"/&gt;
  &lt;/xsd:complexType&gt;
  
  &lt;xsd:element name="address"&gt;
      &lt;xsd:complexType&gt;
          &lt;xsd:choice&gt;
              &lt;xsd:choice&gt;
                  &lt;xsd:element name="elementName" type="Type1"/&gt;
                  &lt;xsd:element name="elementName" type="Type2"/&gt;
              &lt;/xsd:choice&gt;
          &lt;/xsd:choice&gt;
      &lt;/xsd:complexType&gt;
  &lt;/xsd:element&gt;
  </code></pre>
  
  <p>How to do it? <code>address</code> element should be of <code>Type1</code> or <code>Type2</code>. Each type has different attributes.</p>