code: public static String format(String message, Throwable t, boolean includeStackTrace) {
          InternalStringBuilder buf = new InternalStringBuilder();
  
          if(message != null) {
              buf.append(message);
  
              Throwable cause = discoverRootCause(t);
              if(cause != null) {
                  buf.append(HTML_LINE_BREAK);
                  buf.append(CAUSED_BY);
                  buf.append(": ");
                  buf.append(cause.toString());
              }
          }
  
          if(includeStackTrace) {
              if(message != null)
                  buf.append(HTML_LINE_BREAK);
  
              String st = addStackTrace(t);
              buf.append(st);
  
              Throwable rootCause = null;
              Throwable tmp = t;
              while(hasRootCause(tmp) && (rootCause = discoverRootCause(tmp)) != null) {
                  st = addStackTrace(rootCause);
                  buf.append(HTML_LINE_BREAK);
                  buf.append(st);
                  tmp = rootCause;
              }
          }
  
          return buf.toString().replaceAll(LINE_BREAK, HTML_LINE_BREAK);
      }
docs: Format an exception into XHTML.
  <p/>
  Optionally include a message and the stack trace.
  <p/>
  The formatted exception will have line breaks replaced with XHTML line breaks for display
  in HTML.  The String message of the cause will be included, and the stack trace of the
  cause is optionally included given the value of <code>includeStackTrace</code>
  
  @param message           the message to include with the formatted exception.  This is in addition to the message in the stack trace.
  @param t                 a Throwable exception to format
  @param includeStackTrace a boolean that determines whether to include the stack trace in the formatted output
  @return the formatted error message, optionally including the stack trace.