I could not find a simple answer to your first question, however:
What you can do to get an idea of the size of your XML is to stress your font.
I did a stress test in 5 minutes. It probably will not suit you, for having parameters other than your xml (which you did not submit when asking the question) , but it is necessary to explain my argument. Following:
Var
XML : IXMLDOCUMENT;
RootNode, CurNode : IXMLNODE;
i : integer;
begin
XML := NewXMLDocument;
XML.Encoding := 'utf-8';
XML.Options := [doNodeAutoIndent]; // looks better in Editor ;)
RootNode := XML.AddChild('XML');
CurNode := RootNode.AddChild('Teste');
CurNode := CurNode.AddChild('Test22');
CurNode.Text := 'Texto Texto Test';
for I := 0 to 99 do
begin
CurNode.Attributes['Novo_Atributo' + IntToStr(i)] := 'Valor';
end;
XMl.SaveToFile('C:\teste.xml');
With this test I noticed something interesting:
No stretch
for I := 0 to 99 do
begin
CurNode.Attributes['Novo_Atributo' + IntToStr(i)] := 'Valor';
end;
I have the following size on disk: 4,00 KB (4,096 bytes)
Changing the value of the loop from 99 to 199
for I := 0 to 199 do
begin
CurNode.Attributes['Novo_Atributo' + IntToStr(i)] := 'Valor';
end;
I have the following size on disk: 8.00 KB (8,192 bytes)
From there, not reaching your 500kb becomes a simple 3 rule.
As for the second, from the moment your file is saved, as a rule nothing changes its size, be carefree.