public static Slot FIND_SLOT(String name, List slots, boolean useParametricTypeP, boolean useTypeP) {
    if (useTypeP &&
        ((slots.length() == 1) &&
         (XmlObjects.SLOT_BASE_AND_PARAMETER_TYPE(((Slot)(slots.first())), new Object[1]) == XmlObjects.SGT_XML_OBJECTS_XMLObject))) {
      return (((Slot)(slots.first())));
    }
    { Slot result = null;

      { Slot slot = null;
        Cons ITER_000 = slots.theConsList;

        LOOP_000 : for (;!(ITER_000 == Stella.NIL); ITER_000 = ITER_000.rest) {
          slot = ((Slot)(ITER_000.value));
          { Surrogate slotType = null;
            StandardObject slotParametricType = null;

            { Object [] caller_MV_returnarray = new Object[1];

              slotType = XmlObjects.SLOT_BASE_AND_PARAMETER_TYPE(slot, caller_MV_returnarray);
              slotParametricType = ((StandardObject)(caller_MV_returnarray[0]));
            }
            if ((useTypeP &&
                Stella.stringEqlP(name, slotType.symbolName)) ||
                ((useParametricTypeP &&
                Stella.stringEqlP(name, ((GeneralizedSymbol)(slotParametricType)).symbolName)) ||
                 Stella.stringEqlP(name, slot.slotName.symbolName))) {
              result = slot;
              break LOOP_000;
            }
          }
        }
      }
      return (result);
    }
  }