You have to reinstall windows XP first then install windows 8 over top of XP using the upgrade key you got from the retail shop.
Product Keys:
OEM - windows OS is tied to that mobo/cpu and can't be transferred, can be used to clean install generally found on branded (HP, Dell, Acer and so on) retail PC's. You can also purchase an OEM key.
Upgrade - windows OS that allows you to upgrade over an existing install of windows, can't be used to clean install and this is usually cheaper than buying a full blown OEM or Retail key.
Retail - windows OS that comes with both 32/64 bit architecture, is transferable, can be clean installed and usually is the most expensive of the 3.
Link Removed