Is it possible to load data from different xml files into one Java class using XStream?
<p>For instance I have two user accounts: a sender and recipient. Each of them has its own login and password to be used. And these fields are kept in xml config files like this: </p>

<pre><code>&lt;SenderData&gt;
    &lt;login&gt;awesomeLogin&lt;/login&gt;
    &lt;password&gt;awesomePass&lt;/password&gt;
&lt;/SenderData&gt;
</code></pre>

<p>In my tests I created Account class and I want to put there either sender or recipient data: </p>

<pre><code>@XStreamAlias("SenderData")
public class Account {
    private String login, password;
}
</code></pre>

<p>I load required data from xml using <code>com.thoughtworks.xstream @XStream</code> and its alias, annotating the class with <code>@XStreamAlias("SenderData")</code> annotation. </p>

<p>It works perfectly for one specific xml source file, but if I have several xml sources (sender and recipient here) how can I load appropriate data using @XStream?
To be clear, my goal is to have two objects of one Account class, something like this: </p>

<pre><code>Account sender = myXstream.load("SenderData", Account.class); //works!
Account recipient = myXstream.load("RecipientData", Account.class);//doesn't work
</code></pre>

<p>- the last will not work as I can put only one <code>@XStreamAlias("SenderData")</code> annotation to Account class</p>