public static <T> List<T> XmlToObjectCollection(String xml, Class<T> type) throws JAXBException {
        JAXBContext ctx = JAXBContext.newInstance(ObjectMapperHelpers.JAXBCollection.class, type);
        Unmarshaller u = ctx.createUnmarshaller();

        Source src = new StreamSource(IOUtils.toInputStream(xml));
        ObjectMapperHelpers.JAXBCollection<T> collection = u.unmarshal(src, ObjectMapperHelpers.JAXBCollection.class).getValue();
        return collection.getItems();
    }
public static < T > List < T > XmlToObjectCollection ( String xml , Class < T > type ) throws JAXBException { JAXBContext ctx = JAXBContext . newInstance ( ObjectMapperHelpers . JAXBCollection . class , type ) ; Unmarshaller u = ctx . createUnmarshaller ( ) ; Source src = new StreamSource ( IOUtils . toInputStream ( xml ) ) ; ObjectMapperHelpers . JAXBCollection < T > collection = u . unmarshal ( src , ObjectMapperHelpers . JAXBCollection . class ) . getValue ( ) ; return collection . getItems ( ) ; }
Transforms a XML string to an List<Object> using javax.xml.bind.Unmarshaller.
If you want to parse a single Object please @see {#link XmlToObject}

@param xml  string representing a collection of objects
@param type Class of the contained objects within the list
@param <T>  target class
@return a List of T
@throws IOException if is not possible to parse the object