public static Object unmarshal(String message, Class<?> childClass) {
        try {
            Class<?>[] reverseAndToArray = Iterables.toArray(Lists.reverse(getAllSuperTypes(childClass)), Class.class);
            JAXBContext jaxbCtx = JAXBContext.newInstance(reverseAndToArray);
            Unmarshaller unmarshaller = jaxbCtx.createUnmarshaller();

            return unmarshaller.unmarshal(new StringReader(message));
        } catch (Exception e) {
        }

        return null;
    }
public static Object unmarshal ( String message , Class < ? > childClass ) { try { Class < ? > [ ] reverseAndToArray = Iterables . toArray ( Lists . reverse ( getAllSuperTypes ( childClass ) ) , Class . class ) ; JAXBContext jaxbCtx = JAXBContext . newInstance ( reverseAndToArray ) ; Unmarshaller unmarshaller = jaxbCtx . createUnmarshaller ( ) ; return unmarshaller . unmarshal ( new StringReader ( message ) ) ; } catch ( Exception e ) { } return null ; }
xml -> object

@param message
@param childClass
@return