Do you have a real XP installation CD, or a "recovery CD", such as provided
by some PC makers?
The first is intended to perform a clean install on an unforamtted hard
drive. The second is often nothing more than a small program, which expects
to find a hidden partition on the hard drive, which contains an image of the
C: drive. A new hard drive would not contain that image, unless it were
purchased directly from the original PC maker.
Also, some CDs provided by PC makers check the hardware to assure that they
are only being used on the same PC as they were originally issued. This is
to enforce the OEM license, which is install on one, and only one, PC. This
usually means that if the motherboard is changes, as would be the case in a
different PC, the license is not valid.
Try booting the CD in a couple of other PCs. If they get to a screen
offering to install XP, then the problem is the BIOS setup of your PC. If
none of the other PCs get to that point, then the problem lies with the CD
(wrong type, scratches, etc). Youm could also try downloading a image of a
known-good bootable CD, such as one of several LINUX "live" CDs, and see
whetehr any of them will boot on your PC. Finally, many antivirus CDs are
bootable.
If the PC is a common brand (e.g., Dell, Gateway, Compaq, etc), contact
their support group for advice.