code: public static RawData sp2nbsp(Object data) {
          return new RawData(StringEscapeUtils.escapeHtml4(str(data)).replace(" ", "&nbsp;"));
      }
docs: Change space in the data string into <tt>&nbsp</tt>
  @param data
  @return raw data of transformed result