Simple XML deserializing different element types with the same name
<p>I'm trying to deserialize this snippet of XML in Java:</p>

<pre><code>&lt;anime id="16986"&gt;
    &lt;info type="Picture" src="http://~.jpg" width="141" height="200"&gt;
        &lt;img src="http://~" width="141" height="200"/&gt;
        &lt;img src="http://~" width="318" height="450"/&gt;
    &lt;/info&gt;
    &lt;info type="Main title" lang="EN"&gt;Long Riders!&lt;/info&gt;
    &lt;info type="Alternative title" lang="JA"&gt;ろんぐらいだぁす！&lt;/info&gt;
&lt;/anime&gt;
</code></pre>

<p>The problem I'm running into is that the <code>info</code> element either can have an inline list of <code>img</code>'s or it can just contain text. I was thinking of treating <code>info</code> as an <code>@Element</code> in my AnimeHolder class, but I can't have duplicate annotations. I would also like to access the <code>lang</code> attribute of info to check if it is EN or JP.</p>

<p>I am using these classes to hold the deserialized data:</p>

<pre><code>@Root(name="anime", strict=false)
public class AnimeHolder {

    @Attribute(name="id")
    private String ANNID;

    @ElementList(inline=true)
    private List&lt;InfoHolder&gt; infoList;

    public String getANNID() {
        return ANNID;
    }

    public List&lt;InfoHolder&gt; getInfoList() {
        return infoList;
    }
}
</code></pre>

<p>and for the info items:</p>

<pre><code>@Root(name="info", strict = false)
public class InfoHolder {

    @ElementList(inline=true, required = false)
    private List&lt;ImgHolder&gt; imgList;

    @Attribute(name = "lang", required = false)
    private String language;

    public List&lt;ImgHolder&gt; getImgList() {
        return imgList;
    }
}
</code></pre>