code: private WordResolver parseEnumerated(DTDElement elem, PrefixedName attrName,
                                           boolean isNotation)
          throws XMLStreamException
      {
          /* Need to use tree set to be able to construct the data
           * structs we need later on...
           */
          TreeSet<String> set = new TreeSet<String>();
  
          char c = skipDtdWs(true);
          if (c == ')') { // just to give more meaningful error msgs
              throwDTDUnexpectedChar(c, " (empty list; missing identifier(s))?");
          }
  
          HashMap<String,String> sharedEnums;
  
          if (isNotation) {
              sharedEnums = null;
          } else {
              sharedEnums = mSharedEnumValues;
              if (sharedEnums == null && !isNotation) {
                  mSharedEnumValues = sharedEnums = new HashMap<String,String>();
              }
          }
  
          String id = isNotation ? readNotationEntry(c, attrName, elem.getLocation())
              : readEnumEntry(c, sharedEnums);
          set.add(id);
          
          while (true) {
              c = skipDtdWs(true);
              if (c == ')') {
                  break;
              }
              if (c != '|') {
                  throwDTDUnexpectedChar(c, "; missing '|' separator?");
              }
              c = skipDtdWs(true);
              id = isNotation ? readNotationEntry(c, attrName, elem.getLocation())
                  : readEnumEntry(c, sharedEnums);
              if (!set.add(id)) {
                  /* 03-Feb-2006, TSa: Hmmh. Apparently all other XML parsers
                   *    consider it's ok in non-validating mode. All right.
                   */
                  if (mCfgFullyValidating) {
                      throwDTDAttrError("Duplicate enumeration value '"+id+"'",
                                        elem, attrName);
                  }
              }
          }
  
          // Ok, let's construct the minimal data struct, then:
          return WordResolver.constructInstance(set);
      }
docs: Parsing method that reads a list of one or more space-separated
  tokens (nmtoken or name, depending on 'isNotation' argument)