//the namespace is different; must be a ref...
return new QName(elementNamespace, isWrapped() ? getWrapperName() : getName());
}
else {
//check to see if this is an implied ref as per the jaxb spec, section 8.9.1.2
XmlType baseType = getBaseType();
if ((baseType.isAnonymous()) && (baseType instanceof XmlClassType)) {
TypeDefinition baseTypeDef = ((XmlClassType) baseType).getTypeDefinition();
if (baseTypeDef.getAnnotation(XmlRootElement.class) != null) {
RootElementDeclaration rootElement = new RootElementDeclaration((ClassDeclaration) baseTypeDef.getDelegate(), baseTypeDef);
ref = new QName(rootElement.getNamespace(), rootElement.getName());
}