if you are getting windows xp, you should get your own copy. if you share the same product key with windows xp, when you have to activate it within 30 days, that product key will probably be invalid since you and your friends computer may have different components. you can probably find a tool on the internet that will break product activation but that would most likely not allow you to get updates.
since you say you got windows 98, i suggest that you buy the upgrade version of windows xp home or pro instead of the full version to save some money. if you are a student at a college, get the academic version of windows xp. i got my windows xp pro upgrade academic for $20 cheaper than windows xp home upgrade at newegg.com, so you should check it out.
you should do a clean installation of windows xp (remember to backup your important data) as problems may arrive if you install over your previous windows 98 installation. during the windows xp installation, it will ask you for your windows 98 cd. pop in the windows 98 cd, follow the instructions on screen and it should work out.