title: How to generate XSD from elements of XML
body: <p>I have a XML input</p>
  
  <pre><code>&lt;field&gt;
    &lt;name&gt;id&lt;/name&gt;
    &lt;dataType&gt;string&lt;/dataType&gt;
    &lt;maxlength&gt;42&lt;/maxlength&gt;
    &lt;required&gt;false&lt;/required&gt;
  &lt;/field&gt;
  </code></pre>
  
  <p>I am looking for a library or a tool which will take an XML instance document and output a corresponding XSD schema.</p>
  
  <p>I am looking for some java library with which I can generate a XSD for the above XML structure</p>