superhaine
New Member
From some library, I'm getting such an input string:\[code\]<link> <name>button1</name> <target>there</target></link><link> <name>button2</name> <target>there2</target></link>\[/code\](note that this is not an XML document as it has no root) and I have this class:\[code\]@XmlRootElement(name = "link")public class TableTagLinkElement { private String name; private String target; // getters and setters}\[/code\]How can I unmarshall this easily into a list of \[code\]TableTagLinkElement\[/code\]s, in a generic way such that I could implement such a method:\[code\]public <T> List<T> parseCollection(String xmlString, Class<T> rootClass)\[/code\]i.e., without any previous knowledge of the \[code\]TableTagLinkElement\[/code\] class or of the name of the \[code\]<link>\[/code\] tag?I know about solutions that create a wrapper class with a list, but I think they're not applicable here, are they?