First, is this an "OEM" copy (aka, it came with a computer,) or is it a "Retail" copy? (aka, a box bought at a store.)
If it's a Retail copy, read the next paragraph. If it's an OEM copy, then you could potentially run into technical, as well as legal/ethical issues.
From a technical standpoint, a retail copy should install just fine. The worst that will happen is that when it goes to "phone home" to Microsoft, activation will fail, and you will need to call the activation phone line, and tell an operator (likely in India,) that you only have it installed on one machine; you'll have to read off a ridiculously long code, and the operator will give you another ridiculously long code to force activation to work.
For OEM copies, some of them are linked to the specific system (make/model/configuration) that they shipped with. Big OEMs like Dell and HP are famous for this. You cannot take a Dell Dimension 2400 XP install disc and use it even on a Dimension 2800, much less on an HP or an Apple. The disc is hard-coded to only install on the specified computer. "Generic" OEM discs are not linked this way; but there is still the legal/ethical aspect.
From a legal/ethical standpoint, it is only okay to do this if the copy of XP is a "Retail" copy, and it has been completely removed from the previous computer. The "OEM" licenses specify that they are only valid when the software is installed on *the individual computer* the label shipped with. OEM licenses are *NOT* transferrable. Period. Finally, if you use a copy of XP as a basis for an "upgrade" copy of Vista, that copy of Vista subsumes the XP license with it. Meaning you still only have one license combined for *both* copies of Windows. You can't buy an upgrade copy of Vista, then install the now-obsolete copy of XP on a different system. The 'upgrade' price is cheaper because you're 'upgrading' the license as well. (Yes, I read every EULA I agree to at least once all the way through, I have read those clauses in the XP and Vista EULAs.)