title: Is it possible to define a XSD element with an arbitrary name but with specific attributes
body: <p>I would like to validate a custom XML document against a schema.
  This document would include a structure with any number of elements, each having a specific attribute. Something like this:</p>
  
  <pre><code>&lt;Root xmlns="http://tns"&gt;
    &lt;Records&gt;
      &lt;FirstRecord attr='whatever'&gt;content for first record&lt;/FirstRecord&gt;
      &lt;SecondRecord attr='whatever'&gt;content for first record&lt;/SecondRecord&gt;
      ...
      &lt;LastRecord attr='whatever'&gt;content for first record&lt;/LastRecord&gt;
    &lt;/Records&gt;
  &lt;/Root&gt;
  </code></pre>
  
  <p>The author of the XML document can include any number of records, each with an arbitrary name of his or her choosing. How is this possible to validate this against an XML Schema ?</p>
  
  <p>I have tried to specify the appropriate structure type in a schema, but I do not know how to reference it in the appropriate location:</p>
  
  <pre><code>&lt;xs:schema xmlns="http://tns" targetNamespace="http://tns" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
  
      &lt;xs:complexType name="RecordType"&gt; &lt;!-- This is my record type --&gt;
          &lt;xs:simpleContent&gt;
              &lt;xs:extension base="xs:string"&gt;
              &lt;xs:attribute name="attr" type="xs:string" use="required" /&gt; 
              &lt;/xs:extension&gt;
          &lt;/xs:simpleContent&gt;
      &lt;/xs:complexType&gt;
  
      &lt;xs:element name="Root"&gt;
          &lt;xs:complexType&gt;
              &lt;xs:sequence&gt;
                  &lt;xs:element minOccurs="1" maxOccurs="1" name="Records"&gt;
                      &lt;!-- This is where records should go --&gt;
                      &lt;xs:complexType /&gt; 
                  &lt;/xs:element&gt;
              &lt;/xs:sequence&gt;
          &lt;/xs:complexType&gt;
      &lt;/xs:element&gt;
  
  &lt;/xs:schema&gt;
  </code></pre>