cm.ref(JAXBElement.class).narrow(
target.getContentInMemoryType().toType(parent,Aspect.EXPOSED).boxify()));
if(ei.hasClass()) {
JType implType = ei.getContentInMemoryType().toType(parent,Aspect.IMPLEMENTATION);
JExpression declaredType = JExpr.cast(cm.ref(Class.class),implType.boxify().dotclass()); // why do we have to cast?
JClass scope=null;
if(ei.getScope()!=null)
scope = parent.getClazz(ei.getScope()).implRef;
JExpression scopeClass = scope==null?JExpr._null():scope.dotclass();
JFieldVar valField = implClass.field(JMod.PROTECTED|JMod.FINAL|JMod.STATIC,QName.class,"NAME",createQName(cm,ei.getElementName()));
// take this opportunity to generate a constructor in the element class
JMethod cons = implClass.constructor(JMod.PUBLIC);
cons.body().invoke("super")