JAXBRIContext riContext = JAXBRIContext.newInstance(clses.toArray(new Class[clses.size()]),
typeRefs, null, null, true, null);
Bridge bridge = riContext.createBridge(ref);
if (source instanceof XMLStreamWriter) {
bridge.marshal(elValue, (XMLStreamWriter)source);
} else if (source instanceof OutputStream) {
//the namespace is missing when marshal the xsd:QName type
//to the OutputStream directly
java.io.StringWriter sw = new java.io.StringWriter();
StreamResult s1 = new StreamResult(sw);