anchor.diff:    , Produces(TMediaType.APPLICATION_JSON_FIREDAC)
     , Produces(TMediaType.APPLICATION_OCTET_STREAM)
     ]
  -  TFDAdaptedDataSetWriter = class(TInterfacedObject, IMessageBodyWriter)
  +  TFDDataSetWriter = class(TInterfacedObject, IMessageBodyWriter)
       procedure WriteTo(const AValue: TValue; const AMediaType: TMediaType;
         AOutputStream: TStream; const AActivation: IMARSActivation);
     end;
   
     [ Produces(TMediaType.APPLICATION_JSON_FIREDAC) ]
  -  TArrayFDCustomQueryWriter = class(TInterfacedObject, IMessageBodyWriter)
  +  TArrayFDDataSetWriter = class(TInterfacedObject, IMessageBodyWriter)
       procedure WriteTo(const AValue: TValue; const AMediaType: TMediaType;
  +      AOutputStream: TStream; const AActivation: IMARSActivation);
  +    class procedure WriteDataSets(const ADataSets: TValue; const AMediaType: TMediaType;
         AOutputStream: TStream; const AActivation: IMARSActivation);
     end;
   
  
positive.code:   end;
  end;
  
  { TFDAdaptedDataSetWriter }
  
  procedure TFDAdaptedDataSetWriter.WriteTo(const AValue: TValue; const AMediaType: TMediaType;
    AOutputStream: TStream; const AActivation: IMARSActivation);
  var
    LDataset: TFDAdaptedDataSet;
  begin
    LDataset := AValue.AsType<TFDAdaptedDataSet>;
  
    if AMediaType.Matches(TMediaType.APPLICATION_XML) then
      LDataSet.SaveToStream(AOutputStream, sfXML)
    else if AMediaType.Matches(TMediaType.APPLICATION_JSON_FireDAC) then
      StringToStream(AOutputStream, TFDDataSets.DataSetToEncodedBinaryString(LDataSet), TEncoding.UTF8)
    else if AMediaType.Matches(TMediaType.APPLICATION_OCTET_STREAM) then
      LDataSet.SaveToStream(AOutputStream, sfBinary)
    else
  
negative.code: 
  procedure RegisterReadersAndWriters;
  begin
    TMARSMessageBodyRegistry.Instance.RegisterWriter<TFDDataSet>(TFDDataSetWriter);
  
    TMARSMessageBodyRegistry.Instance.RegisterWriter(
      TArrayFDDataSetWriter
    , function (AType: TRttiType; const AAttributes: TAttributeArray; AMediaType: string): Boolean
      begin
        Result := Assigned(AType) and AType.IsDynamicArrayOf<TFDDataSet>;
  