uses NativeXml;
procedure TForm1.Button1Click(Sender: TObject);
begin
Caption := fXML.Root.FindNode('father').Value; {tom}
end;
procedure TForm1.CreateXMLClick(Sender: TObject);
begin
fXML.CreateName('root'); // create root node
with fXML.Root.NodeNew('student') do begin // create level 1 sub node
WriteAttributeString('class', '88');
WriteString('name', 'baby');
WriteInteger('age', 18);
with NodeNew('FamilyMember') do begin // create level 2 sub node
WriteString('father', 'tom');
WriteString('mother', 'jene');
end;
end;
fXML.SaveToFile('1.xml');
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
fXML := TNativeXml.Create(Self);
end;