title: Delphi DOM Xml appendChild in for statements
body: <p>AHello I am currently working on a project that allows interaction between xml files and DataSet. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>    // Number of lines of the DataSet = Number of "REC" element
      for i := 0 to aDataSet.RecordCount - 1 do
      begin
        // Create a new Node
        aNewNode := aXml.createElement('REC');
  
        for j := 0 to slColumnName.Count - 1 do
        begin
          aNewNode.setAttribute('x','y');
        end;
  
        // Add new Node
        aNodeTBL.appendChild(aNewNode);
      end;
  </code></pre>
  
  <p>aNodeTBL -> Corresponds to the parent node, I want to create as many nodes "REC" that lines my DataSet. </p>
  
  <p>I can see that I'm still on the "aNewNode", so juste one "REC" node is written</p>
  
  <p>Should I re-instantiate "aNewNode" ? </p>