try {
Set<Class<?>> classes = new HashSet<Class<?>>();
classes.add(ObjectFactory.class);
classes.add(org.apache.cxf.ws.security.sts.provider.model.wstrust14.ObjectFactory.class);
CachedContextAndSchemas cache =
JAXBContextCache.getCachedContextAndSchemas(classes, null, null, null, false);
JAXBContext jaxbContext = cache.getContext();
Marshaller marshaller = jaxbContext.createMarshaller();
Document doc = DOMUtils.createDocument();
Element rootElement = doc.createElement("root-element");
JAXBElement<UsernameTokenType> tokenType =