Java tutorial
//package com.java2s; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; public class Main { /** * Create a {@link Unmarshaller} for the given context and return it. * * @param jaxbContextName the context name where to look to find jaxb classes * @return the created {@link Unmarshaller} * @throws JAXBException */ public static Unmarshaller createUnmarshaller(final String jaxbContextName, ClassLoader cl) throws JAXBException { final JAXBContext jaxbContext = JAXBContext.newInstance(jaxbContextName, cl); return jaxbContext.createUnmarshaller(); } }