title: Xml file generator in java
body: <p>I want to make a java swing application from where i can generated xml file which hold same data,and generated number of file will be decided by user.My xml file holds xml schema and my xml file struture is looking like this</p>
  
  <pre><code>&lt;transaction&gt;
    &lt;xs:schema id="transaction" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"&gt;
      &lt;xs:element name="transaction" msdata:IsDataSet="true" msdata:UseCurrentLocale="true"&gt;
        &lt;xs:complexType&gt;
          &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
            &lt;xs:element name="id"&gt;
              &lt;xs:complexType&gt;
                &lt;xs:sequence&gt;
                  &lt;xs:element name="name" type="xs:string" minOccurs="0" /&gt;
                  &lt;xs:element name="sn" type="xs:string" minOccurs="0" /&gt;
                &lt;/xs:sequence&gt;
              &lt;/xs:complexType&gt;
            &lt;/xs:element&gt;
            &lt;xs:element name="data"&gt;
              &lt;xs:complexType&gt;
                &lt;xs:sequence&gt;
                  &lt;xs:element name="dateTime" type="xs:dateTime" minOccurs="0" /&gt;
                  &lt;xs:element name="key" type="xs:string" minOccurs="0" /&gt;
                &lt;/xs:sequence&gt;
              &lt;/xs:complexType&gt;
            &lt;/xs:element&gt;
            &lt;xs:element name="productData"&gt;
              &lt;xs:complexType&gt;
                &lt;xs:sequence&gt;
                  &lt;xs:element name="dateTime" type="xs:dateTime" minOccurs="0" /&gt;
                  &lt;xs:element name="key" type="xs:string" minOccurs="0" /&gt;
                &lt;/xs:sequence&gt;
              &lt;/xs:complexType&gt;
            &lt;/xs:element&gt;
          &lt;/xs:choice&gt;
        &lt;/xs:complexType&gt;
      &lt;/xs:element&gt;
    &lt;/xs:schema&gt;
    &lt;id&gt;
      &lt;name&gt;smith&lt;/tli&gt;
      &lt;sn&gt;1234567&lt;/sn&gt;
    &lt;/id&gt;
    &lt;data&gt;
      &lt;dateTime&gt;2011-06-24T17:08:36.3727674+05:30&lt;/dateTime&gt;
      &lt;key&gt;book&lt;/key&gt;
    &lt;/data&gt;
    &lt;productData&gt;
      &lt;dateTime&gt;2011-06-24T17:08:36.3727674+05:30&lt;/dateTime&gt;
      &lt;key&gt;game&lt;/key&gt;
    &lt;/productData&gt;
  &lt;/transaction&gt;
  </code></pre>
  
  <p>I am new in java if some one give some code snipes help, it will be more helpful for me.</p>
  
  <p>I want to generate xml files which hold the xml schema which is given in my example xml.</p>