[% IF (complexType.get_variety == 'restriction');
    INCLUDE complexType/restriction.tt(complexType = complexType);
ELSIF (complexType.get_variety == 'extension');
    INCLUDE complexType/extension.tt(complexType = complexType);
ELSIF (complexType.get_variety == 'sequence');
    INCLUDE complexType/extension.tt(complexType = complexType);
ELSIF (complexType.get_variety == 'all');
    INCLUDE complexType/extension.tt(complexType = complexType);
ELSE;
    IF (complexType.get_variety);
        THROW UNKNOWN, "unknown variety ${ complexType.get_variety }";
    ELSE -%]
# empty variety
[%  END;
END;
%]