uses Classes; // Add this to the top of the script
function ReadXMLFile(Filename: String): String;
var
T: TStringList;
S: String;
begin
T := TStringList.Create;
try
// Loads the XML file in the same path as the ebook EXE file.
EbookPath := GetGlobalVar("HEPublicationPath", "");
S := EbookPath + Filename;
T.LoadFromFile(S);
// Gets the contents.
Result := T.Text;
finally
T.Free;
end;
end;