code: public Response buildErrorResponse(int statusCode, String msg) {
          ResponseBuilder rspBuilder = Response.status(statusCode);
          rspBuilder.type("application/xhtml+xml; charset=UTF-8");
          rspBuilder.entity(createErrorEntityAsString(statusCode, msg));
          return rspBuilder.build();
      }
docs: Builds a response message that indicates some kind of error has occurred.
  The error message is included as the content of the xhtml:body/xhtml:p
  element.
  
  @param statusCode
  The relevant HTTP error code (4xx, 5xx).
  @param msg
  A brief description of the error condition.
  @return A <code>Response</code> instance containing an XHTML entity.