schema xs = (schema) this.get_owner();
// attributes and attribute groups appearing in the restriction must also appear in the base
// assume anyAttribute is not inherited in the same way
XMLBean b = get_baseType(ctx.getModel(),ctx);
if (b!=null && b instanceof simpleType)
return ((simpleType)b).toXML(e,rdf,ctx);
else if (b!=null && b instanceof complexType)
return ((complexType)b).toXML(e,rdf,pending,ctx);
else return xs.toXMLText(e,rdf,expandQName(ctx.getDefaultNS(),base, ctx.getModel()),null,ctx);