Help needed with xml code.. lazarus / 8-Other ---------------------------------------------------------------------- tortho · 2006-05-19 15:43 I'm trying to save some hour counters for some machinery to a file everyday... But this code is overwiting the Dayxxx node... Why is it doing this? I thought the appendchild would maka a: Day18.05.2006 Day19.05.2006 and so on, but it is just showing the latest one.. Any comments is nice :-) ///////////////////////////// //Saving Hour Data To File // ///////////////////////////// procedure TForm1.SaveData(); var    N,M,sub:TDOMNode;    E:TDomElement;    hoursdata:TXMLDocument; begin      //Set the file to save to      try      hoursdata:=TXMLDocument.Create;      except      on E: Exception do      begin      ShowMessage('Exception class name = '+E.ClassName);      ShowMessage('Exception Message = '+E.Message);      end;      end;      //Add the data to save      //Create & append the root element      N:=hoursdata.CreateElement('root'+DateToStr(CurrentDate));      hoursdata.AppendChild(N);      //Create & append the date element      M:=hoursdata.CreateElement('Date'+DateToStr(CurrentDate));      N.AppendChild(M);          //Add all the childs to this element      sub:=hoursData.CreateElement('Component1');      E:=sub as TDOMElement;      E['Component1OldHours']:=EComponent1OldHours.Caption;      E['Component1WorkingHours']:=EComponent1WorkingHours.Caption;      E['Component1TodayHours']:=EComponent1TodayHours.Caption;      E['Component1TotalHours']:=EComponent1TotalHours.Caption;      M.AppendChild(sub);                                             and then the witexmlfile...........