How to map ArrayList data to an DTO
<p>As per the requirement, I have parsed an XML file and set data into these two DTO classes:</p>

<pre><code>public class DetailsDTO implements java.io.Serializable {
private String      userid;
private String      accountnum;
private Customer    customer;
// setters and getters

public class Customer implements Serializable
{
private String            street;
private String            country;
// setters and getters
</code></pre>

<p>After adding data of the <code>Customer</code> class to <code>DetailsDTO</code>, I added this <code>DetailsDTO</code> to an <code>ArrayList</code> as shown:</p>

<pre><code>List list = new ArrayList();
// and added these DetailsDTO class to an ArrayList
list.add(detailsDTO)
</code></pre>

<p>Now there is a Master DTO called as <code>WholeDetails</code> which consists of all variables defined in various DTO classes as shown.</p>

<pre><code>class WholeDetails
{
private String   userid;
private String   accountnum;
private String   street;
private String   country;
}
</code></pre>

<p>Now, as you see, all the data is aviable within the <code>ArrayList</code>.</p>

<p>How can I extract the contents from <code>ArrayList</code> and map it to the <code>WholeDetails</code>?</p>
