As Lasereth said, formatting and reinstalling Windows is the best and most thorough route. But, with Rotten's idea in mind, Repairing Windows actually <i>does work</i>. I've used it many times to switch a motherboard or other similar things. When you boot from the Windows XP CD, choose Repair a Windows Installation (or something like it) instead of Install.
I highly suggest you either Repair or Format and Reinstall Windows. Do not switch the hardware and leave the OS intact (if you can even get it to work). It leads to problems