Append TFDMemTable data into one XML file
<p>Is there any way to save all the database records and structures <em>for multiple queries</em> into one XML file? </p>

<p>What I did is:</p>

<pre><code>procedure CopyRecords(Sender: TObject);
begin
  try

  TFDQuery.SQL.Text := 'SELECT * FROM SAMPLE_TABLE1';
  TFDQuery.FetchOptions.Unidirectional := False;
  TFDQuery.Open;
  TFDQuery.FetchAll;

  TFDmemtable.Data := DM.qry_SQL.Data;
  TFDmemtable.First;

  while not TFDmemtable.Eof do
  begin
    TFDmemtable.Edit;

    TFDmemtable.Post;
    TFDmemtable.Next;
  end;

  TFDmemtable.SaveToFile('C:\Test.xml', sfXML); 
  finally
    TFDmemtable.Close;
  end;
end;
</code></pre>

<p>This works fine for one query, but if I change the SQL text and keep the file name the comtents gets overriden. I want to change the query (SQL.text) and save all the query data into <strong>one</strong> XML file.</p>

<pre><code>TFDQuery.SQL.Text := 'SELECT * FROM SAMPLE_TABLE1';
... save ...
TFDQuery.SQL.Text := 'SELECT * FROM SAMPLE_TABLE2';
... save (append) ...
</code></pre>