title: How to generate xsd file using java code?
body: <pre><code>&lt;complexType name="spThread"&gt;
          &lt;sequence&gt;
              &lt;element name="SPThreadID" type="int" /&gt;
              &lt;element name="durtime" minOccurs="0" default="0"&gt;
                  &lt;simpleType&gt;
                      &lt;restriction base="int"&gt;
                          &lt;minInclusive value="0" /&gt;
                      &lt;/restriction&gt;
                  &lt;/simpleType&gt;
              &lt;/element&gt;
              &lt;element name="minexecutions" minOccurs="0" default="0"&gt;
                  &lt;simpleType&gt;
                      &lt;restriction base="int"&gt;
                          &lt;minInclusive value="0" /&gt;
                      &lt;/restriction&gt;
                  &lt;/simpleType&gt;
              &lt;/element&gt;
              &lt;element name="numThreads" type="int" /&gt;
              &lt;element name="procedures" type="spm:procedure" minOccurs="1"
                  maxOccurs="unbounded" /&gt;
          &lt;/sequence&gt;
      &lt;/complexType&gt;
  </code></pre>
  
  <p>i want to generate this type of .xsd file using java code..? How can i do that.?</p>
  
  <p>Specially how to generate Simple type elements and put restrictions on it ?</p>