code: public StringBuilder replaceNamedEntity(StringBuilder sb) {
          for (NamedEntityEnum nEnum : NamedEntityEnum.values()) {
              int i;
              while ((i = sb.indexOf(nEnum.getName())) > -1) {
                  sb.replace(i, i + nEnum.getName().length(), nEnum.getNumber());
              }
          }
          return sb;
      }
docs: <p>
  replace the reference of character entity reference to numeric character
  reference.
  </p>
  
  @param sb
  xhtml template
  @return replaced xhtml template