title: How could I customize StaxEventItemWriter to have a control over xml file writing ?
body: <p>I need to generate a xml in spring batch from database records. Spring batch have provided StaxEventItemWriter for generating xml. But My output xml is not usual xml. It has header and body and inside body it has one element which gets repeated in spring batch processing in chunks. The output xml format is as below.I couldn't find a way to override methods provided in StaxEventItemWriter to achieve this. </p>
  
  <pre><code>       &lt;Document&gt;
            &lt;header&gt;
             &lt;groupheader&gt;
              ......
             &lt;/groupheader&gt;
             &lt;Body&gt;
              &lt;data&gt;
              .......
              &lt;/data&gt;
              &lt;record&gt;
              .........
              &lt;/record&gt;
              &lt;record&gt;
              .........
              &lt;/record&gt;
              &lt;record&gt;
              .........
              &lt;/record&gt;
              .........repeating element
            &lt;/Body&gt;
      &lt;/Document&gt;
  </code></pre>