Depends. You may not legally use the same copy of Windows XP on two different machines.
In many cases, you can load it on a computer that replaces your old one, as long as you bought a retail version.
They no longer allow you to transfer an OEM version of XP to be loaded onto a new machine. They are bound to the motherboard. If a machine loaded with the OEM version of XP dies because of a faulty mainboard, it must be replaced with the same motherboard.
Same make & model motherboard, that is...