According to the Spring Batch document, Spring Batch could generate the formatted xml file, but I failed, all XML elements are generated in one line.

Test steps

1. Download spring-batch-2.1.9.RELEASE-no-dependencies
2. Import spring-\*-3.2.0.RC1.jar
3. Import jaxb-ri-2.2.6
4. Run org.springframework.batch.sample.iosample.XmlFunctionalTests

Before running the job, I make below changes on /spring-batch-2.1.9.RELEASE-no-dependencies/spring-batch-2.1.9.RELEASE/spring-batch-samples/src/main/resources/jobs/iosample/xml.xml

```
<bean id="itemWriter" class="org.springframework.batch.item.xml.StaxEventItemWriter">
    <property name="resource" ref="outputResource" />
    <property name="marshaller" ref="customerCreditMarshaller2" />
    <property name="rootTagName" value="customers" />
    <property name="overwriteOutput" value="true" />
</bean>
<bean id="customerCreditMarshaller2" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
     <property name="contextPaths">
         <list>
             <value>com.test.domain</value><!-- the package is generated from a XSD -->
         </list>
   </property>
   <property name="marshallerProperties">
        <map>
           <entry key="jaxb.formatted.output"><value type="java.lang.Boolean">true</value></entry>
        </map>
   </property>

```