private static void appendLegalized(@NotNull @NonNls StringBuilder sb, char each) {
    if (each == '<' || each == '>') {
      sb.append(each == '<' ? "&lt;" : "&gt;");
    }
    else if (!Verifier.isXMLCharacter(each)) {
      String s = Long.toHexString(each);
      sb.append("0x").append(s.toUpperCase(Locale.ENGLISH));
    }
    else {
      sb.append(each);
    }
  }
private static void appendLegalized(@NotNull @NonNls StringBuilder sb, char each)