code: private StringBuilder format(final MapFormat format, final StringBuilder sb) {
          if (format == null) {
              appendMap(sb);
          } else {
              switch (format) {
                  case XML : {
                      asXml(sb);
                      break;
                  }
                  case JSON : {
                      asJson(sb);
                      break;
                  }
                  case JAVA : {
                      asJava(sb);
                      break;
                  }
                  default : {
                      appendMap(sb);
                  }
              }
          }
          return sb;
      }
docs: Formats the Structured data as described in <a href="https://tools.ietf.org/html/rfc5424">RFC 5424</a>.
  
  @param format The format identifier.
  @return The formatted String.