code: public static String escape(String string, Document.OutputSettings out) {
          if (string == null)
              return "";
          StringBuilder accum = StringUtil.borrowBuilder();
          try {
              escape(accum, string, out, false, false, false);
          } catch (IOException e) {
              throw new SerializationException(e); // doesn't happen
          }
          return StringUtil.releaseBuilder(accum);
      }
docs: HTML escape an input string. That is, {@code <} is returned as {@code &lt;}
  
  @param string the un-escaped string to escape
  @param out the output settings to use
  @return the escaped string