But generally speaking No it's not legal unless you are willing to spend quite a lot of time and money in a court action as M$ specifically states in their EULA that XP Pro can be used on 2 CPU's so you can walk into any court World Wide and claim that M$ has accepted that you have the right to use XP Pro on either a Dual Processor computer or 2 Single Processor Computers and by Single Processor I don't mean Single Core but just the 1 CPU Chip. Provided that you only have 1 CPU Chip per computer you can argue this in court and will stand a chance of winning maybe!
If it's an OEM copy that was slipstreamed to one makers hardware then you have to buy another copy as it will not be suitable for your new computer as it will lack the necessary drivers but if you have a Full OEM Copy you could use that to install from or a Retail Copy which I believe in some parts of the world is transferable between different hardware.
Col