Is this the only hard drive in the computer? If you have multiple drives, try removing all others that you're not going to use until after XP installation. In any case, this could be a number of things.
1) Power supply isn't good enough to support more hardware (or is dying).
2) Memory is not seated correctly or is going bad.
3) Any of a number of hardware pieces are going bad.
Anyway, try removing any hard drives you're not going to use during installation. Check your memory (perhaps it got nudged when you put in the new hard drive and needs reseated). Check your other hardware (sound/video cards, etc.) and reseat them if needed.
We do need to know exactly what model of HP this is. That way we know what you're working with. In addition to that, what other hardware have you added to it, if any.