it can not be done (effectively)and in your case even not recommended.
for one the general idea is to copy the data over and not the programs, since program installs .dll and .ini in all kind of different folders, and you ( or programs has to be able to track all of them to transfer effectively)
second: you are saying you want to transfer them to a different operating system too.
when a programs installs itself on a system , it installs the files for that particular operating system. a win98 installation uses different .dll , etc files then it's xp cousin.
so if you copy those from win98 to xp you will surely experience problems.
Not to mention that one of the main reasons to use the xp version of the program is for the stabillity of the operating system, as you know win98 is less stable than the xp, you are introducing a win98 less stable program to xp, and it could work but it will also deteriote the stabillity of the xp operating system.
as you could see in the link above (previous answer) the idea is to transfer files from the same operating system.
Hope I was clear
Leopold