Here you can find the source of converyToJavaBean(String xml, Class
public static <T> T converyToJavaBean(String xml, Class<T> clazz)
//package com.java2s; import java.io.StringReader; import javax.xml.bind.JAXB; public class Main { public static <T> T converyToJavaBean(String xml, Class<T> clazz) { T t = (T) JAXB.unmarshal(new StringReader(xml), clazz); return t; }/*from w w w . j a v a 2 s .c o m*/ }