title: How to skip bean transformation in StaxEventItemReader?
body: <p>I'd like to use <code>spring-batch</code> for processing xml files.
  There is already a <code>StaxEventItemReader</code> for parsing.</p>
  
  <p>Problem: the reader requires a <code>Bean</code> object that is created for each record in the xml.</p>
  
  <p>Example from 
  <a href="https://github.com/pkainulainen/spring-batch-examples/blob/master/spring-boot/src/main/java/net/petrikainulainen/springbatch/xml/in/XmlFileToDatabaseJobConfig.java" rel="nofollow noreferrer">https://github.com/pkainulainen/spring-batch-examples/blob/master/spring-boot/src/main/java/net/petrikainulainen/springbatch/xml/in/XmlFileToDatabaseJobConfig.java</a></p>
  
  <pre><code>    @Bean
      ItemReader&lt;StudentDTO&gt; xmlFileItemReader(Environment environment) {
          StaxEventItemReader&lt;StudentDTO&gt; xmlFileReader = new StaxEventItemReader&lt;&gt;();
          xmlFileReader.setResource(new ClassPathResource(environment.getRequiredProperty(PROPERTY_XML_SOURCE_FILE_PATH)));
          xmlFileReader.setFragmentRootElementName("student");
  
          Jaxb2Marshaller studentMarshaller = new Jaxb2Marshaller();
          studentMarshaller.setClassesToBeBound(StudentDTO.class);
  
          xmlFileReader.setUnmarshaller(studentMarshaller);
          return xmlFileReader;
      }
  </code></pre>
  
  <p>Question: how can I tell the reader to <em>not</em> parse to a bean, but just output a flat csv from each record, without having to transform to a bean prior?</p>
  
  <p>Regarding the example, I want to skip <code>StudentDTO</code> objects creation, and just get the plain values from the reader as eg csv or list.</p>