Here you can find the source of unmarshall(String xml, Class... classesToBeBound)
public static Object unmarshall(String xml, Class... classesToBeBound) throws JAXBException
//package com.java2s; //License from project: Open Source License import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; import java.io.StringReader; public class Main { public static Object unmarshall(String xml, Class... classesToBeBound) throws JAXBException { JAXBContext context = JAXBContext.newInstance(classesToBeBound); Unmarshaller unmarshaller = context.createUnmarshaller(); StringReader reader = new StringReader(xml); return unmarshaller.unmarshal(reader); }//from w w w .j a v a2 s . co m }