class XmlHelper {

    @SuppressWarnings("unchecked")
    public <T> T unmarshallXmlToObject(Class<T> classType, String xmlString) throws JAXBException
    {
        JAXBContext context = JAXBContext.newInstance(classType);
        Unmarshaller un = context.createUnmarshaller();
        return (T) un.unmarshal(IOUtils.toInputStream(xmlString));
    }

}