<div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">The memory leak is caused by using the ChildNodes property. Each time<br> you use it, a new TDOMNodeList object is created, which must be<br>
eventually destroyed by calling Free. The FCL DOM implementation does<br> not offer automatic memory management here, unlike other implementations.</blockquote><div><br>
Then how can I free those TDOMNodeList objects? I.o.w. how can I get access to them?<br>
</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Some time ago I updated the English page of Wiki tutorial to reflect<br> this fact.</blockquote>
<div><br>
Yep, just re-read the article and saw the note... <br>
</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> In your case, ChildNodes.Item[0] can be replaced by FirstChild, which<br> will return exactly the same node.</blockquote>
<div><br>
I tried that, and it wordk like a charm.<br>
However can I use that approach if I want to create more complex XML files?<br>
<br>
Eventually I want someting like this:<br>
<?xml version="1.0"?><br>
<root><br>
<version>foo bar version 0.0.1</version><br>
<children><br>
<child id="0001"><br>
<foo>Bart</foo><br>
<bar>me, myself and I</bar><br>
</child><br>
<child id="0002"><br>
<foo>Bob</foo><br>
<bar>blah</bar><br>
</child><br>
<children/><br>
</root><br>
<br>
Bart</div></div>