Microsoft has two main licence models and this can be relevant when re-building a PC.
The version of XP shipped with new PCs is usualy an "OEM" version - this means it is only licenced for the PC it was shipped with, and to make matters worse it can auto-detect significant hardware changes...