Here you can find the source of fromStringToObject(String xmlString, Class
public static <T> T fromStringToObject(String xmlString, Class<T> xmlObjClass)
//package com.java2s; //License from project: Apache License import javax.xml.bind.JAXB; import java.io.StringReader; public class Main { public static <T> T fromStringToObject(String xmlString, Class<T> xmlObjClass) { return JAXB.unmarshal(new StringReader(xmlString), xmlObjClass); }/*from www . j a v a 2s .c om*/ }