title: convert multiple xml to csv in apache camel
body: <p>I want to convert multiple xml object to csv  object in apache camel. But I am just able to convert single object. With reference to below and attached code, I have tried some method sI have xml file like this </p>
  
  <pre><code>&lt;company&gt;
  &lt;employee&gt;
      &lt;empId&gt;1&lt;/empId&gt;
      &lt;empName&gt;peter&lt;/empName&gt;
      &lt;sal&gt;56000&lt;/sal&gt;
  &lt;/employee&gt;
  &lt;employee&gt;
      &lt;empId&gt;2&lt;/empId&gt;
      &lt;empName&gt;mary&lt;/empName&gt;
      &lt;sal&gt;96000&lt;/sal&gt;
  &lt;/employee&gt;
  &lt;employee&gt;
      &lt;empId&gt;3&lt;/empId&gt;
      &lt;empName&gt;alex&lt;/empName&gt;
      &lt;sal&gt;96000&lt;/sal&gt;
  &lt;/employee&gt;
  </code></pre>
  
  <p>
   and want to convert it to csv. But I only manage to convert one data But i have no clue how to change the whole set </p>
  
  <pre><code>@Override
  public void configure() throws Exception {
  
  //      Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();         
  
      JaxbDataFormat xmlDataFormat = new JaxbDataFormat();                        //1.  XML Data Format
      JAXBContext con = JAXBContext.newInstance(company.class);
      xmlDataFormat.setContext(con);
  
  DataFormat  csv  = new BindyCsvDataFormat(employee.class);
  
  
      from("file:C:/inputFolder/.camel/xml?noop=true")
      .unmarshal(xmlDataFormat)
      .split(body(String.class).tokenize(","))
  
  //Unmarshaled debug part 
      .process(new Processor(){
          public void process(Exchange exchange) throws Exception {
  
              //print string //
  
              String myString = exchange.getIn().getBody(String.class);
              System.out.println("unmarshalled output" + myString);
              //print string//
  
              //print array //
          //  Message msg =exchange.getIn() ;
          //  ArrayList&lt;Employee&gt; list = msg.getBody(ArrayList.class);
                      //list.forEach(emp -&gt; System.out.println(emp));
              //print array //
              ////        }}
  
          }})
  //Unmarshaled debug part 
  
  
      .marshal(csv)
      .to("file:C:/outputFolder/csv").
  
      // Marshalled output 
      process(new Processor(){
                      public void process(Exchange exchange) throws Exception {
                          //print string//
                          String myString = exchange.getIn().getBody(String.class);
                         System.out.println("marshalled output" + myString);
                        //print string//
  
                          //print array //
                          //Message msg =exchange.getIn() ;
                      //  ArrayList&lt;Employee&gt; list = msg.getBody(ArrayList.class);
                      //          list.forEach(emp -&gt; System.out.println(emp));
                          //print array //
                      }})                  
      ;}
  
  
  }
  </code></pre>