code: private Mode makeBuiltinMode(String name, Class cls) {
      // lookup/create a mode with the given name.
      Mode mode = lookupCreateMode(name);
      // Init the element action set for this mode.
      ActionSet actions = new ActionSet();
      // from the current mode we will use further the built in mode.
      ModeUsage modeUsage = new ModeUsage(Mode.CURRENT, mode);
      // Add the action corresponding to the built in mode.
      if (cls == AttachAction.class)
        actions.setResultAction(new AttachAction(modeUsage));
      else if (cls == AllowAction.class)
        actions.addNoResultAction(new AllowAction(modeUsage));
      else if (cls == UnwrapAction.class)
        actions.setResultAction(new UnwrapAction(modeUsage));
      else
        actions.addNoResultAction(new RejectAction(modeUsage));
      // set the actions on any namespace.
      mode.bindElement(NamespaceSpecification.ANY_NAMESPACE, NamespaceSpecification.DEFAULT_WILDCARD, actions);
      // the mode is not defined in the script explicitelly
      mode.noteDefined(null);
      // creates attribute actions
      AttributeActionSet attributeActions = new AttributeActionSet();
      // if we have a schema for attributes then in the built in modes
      // we reject attributes by default
      // otherwise we attach attributes by default in the built in modes
      if (attributesSchema)
        attributeActions.setReject(true);
      else
        attributeActions.setAttach(true);
      // set the attribute actions on any namespace
      mode.bindAttribute(NamespaceSpecification.ANY_NAMESPACE, NamespaceSpecification.DEFAULT_WILDCARD, attributeActions);
      return mode;
    }
docs: Makes a built in mode.
  @param name The mode name.
  @param cls The action class.
  @return A Mode object.