Tree: TXdbxAnalysis;
FDataStream: TMemoryStream;
{FDataStream:= TMemoryStream.Create;
FDataStream.LoadFromFile('D:\4.txt');
Tree:=TXdbxAnalysis.Create;
Tree.deserialize(FDataStream.Memory,FDataStream.Size);
Root:=Tree.root; }
doc: TTBXDocument;
element,root: TTBXElement;
tmpInt: Int64;
stream, data: TMemoryStream;
{doc := TTBXDocument.Create('');
root := doc.CreateElement('request');
element := root.CreateElement('description');
element.SetAttribute('system',3);
element.SetAttribute('type',1);
element := element.CreateElement('operator');
element.SetAttribute('name','zc');
element.SetAttribute('id','3GW1D3FC8F');
element := root.CreateElement('data');
stream := TMemoryStream.Create;
data := TMemoryStream.Create;
doc.SaveToStream(data,pfXDBX);
tmpInt := 1;
stream.Write(tmpInt,4);
stream.Write(tmpInt,8);
tmpInt := data.Size;
stream.Write(tmpInt,4);
//stream.CopyFrom(data,0);
data.SaveToFile('D:\3.txt');