code: private Tag getTag(Element node, Tag... tags) {
          String name = node.getTagName();
          String error = null;
          
          try {
              Tag tag = Tag.valueOf(name.toUpperCase());
              int i = ArrayUtils.indexOf(tags, tag);
  
              if (i < 0) {
                  error = "Tag '%s' is not valid at this location";
              } else {
                  if (!tag.allowMultiple) {
                      tags[i] = null;
                  }
  
                  return tag;
              }
          } catch (IllegalArgumentException e) {
              error = "Unrecognized tag '%s' in layout";
          }
  
          throw new IllegalArgumentException(getInvalidTagError(error, name, tags));
      }
docs: Return and validate the tag type, throwing an exception if the tag is unknown or among the
  allowable types.
  
  @param node The DOM node.
  @param tags The allowable tag types.
  @return The tag type.