code: public boolean isValid() {
          switch (htmlTag) {
              case A :
                  return (hasAttr(HtmlAttr.NAME) || hasAttr(HtmlAttr.ID) || (hasAttr(HtmlAttr.HREF) && hasContent()));
              case BR :
                  return (!hasContent() && (!hasAttrs() || hasAttr(HtmlAttr.CLEAR)));
              case IFRAME :
                  return (hasAttr(HtmlAttr.SRC) && !hasContent());
              case HR :
              case INPUT:
                  return (!hasContent());
              case IMG :
                  return (hasAttr(HtmlAttr.SRC) && hasAttr(HtmlAttr.ALT) && !hasContent());
              case LINK :
                  return (hasAttr(HtmlAttr.HREF) && !hasContent());
              case META :
                  return (hasAttr(HtmlAttr.CONTENT) && !hasContent());
              case SCRIPT :
                  return ((hasAttr(HtmlAttr.TYPE) && hasAttr(HtmlAttr.SRC) && !hasContent()) ||
                          (hasAttr(HtmlAttr.TYPE) && hasContent()));
              default :
                  return hasContent();
          }
      }
docs: Returns true if the HTML tree is valid. This check is more specific to
  standard doclet and not exactly similar to W3C specifications. But it
  ensures HTML validation.
  
  @return true if the HTML tree is valid