code: private ComposableBody applySessionData(
              final long rid,
              final ComposableBody orig) throws BOSHException {
          assertLocked();
  
          Builder builder = orig.rebuild();
          builder.setAttribute(Attributes.SID,
                  cmParams.getSessionID().toString());
          builder.setAttribute(Attributes.RID, Long.toString(rid));
  
          if(cfg.isAckEnabled()) {
              applyResponseAcknowledgement(builder, rid);
          }
          return builder.build();
      }
docs: Applies existing session data to the outbound request, returning the
  modified request.
  
  This method assumes the lock is currently held.
  
  @param rid request ID to use
  @param orig original/raw request
  @return modified request with session information applied