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