title: How to convert a List of POJOs to XML Elements
body: <p>I'm using Spring Boot and I want to convert a POJO to XML. What is the Simplest way of doing it?</p>
  
  <p>For example, I have a <code>Person</code> POJO:</p>
  
  <pre><code>public class Person {
    private String firstName;
    private String lastName;
    //getters/setters
  }
  </code></pre>
  
  <p>How do I convert a <code>List&lt;Person&gt;</code> to this:</p>
  
  <pre><code>&lt;rootElement&gt;
    &lt;person&gt;
      &lt;firstName&gt;John&lt;/firstName&gt;
      &lt;lastName&gt;Smith&lt;/lastName&gt;
    &lt;/person&gt;
  &lt;/rootElement&gt;
  </code></pre>
  
  <p>And what class should I use to encapsulate it in? The equivalent for Jackson is <code>JsonNode</code> from <code>com.fasterxml.jackson.databind</code> package. Are there any preconfigured beans I can use from Spring Boot?</p>