uses sysutils, classes, DOM, XMLParser, XMLWriter; var vParser : XMLParser.TParser; vStream : TStream; vWriter : XMLWriter.TWriter; vDocument : DOM.TDocument; begin vStream := TFileStream.Create('data.XML', fmOpenRead); vParser := XMLParser.TParser.Create(vStream, True); vDocument := vParser.Parse(); FreeAndNil(vParser); vStream := TFileStream.Create('data_out.XML', fmCreate); vWriter := XMLWriter.TWriter.Create(vStream, True, True); vWriter.WriteDocument(vDocument); FreeAndNil(vWriter); FreeAndNil(vDocument); end.