How old is the compaq? Some of the older ones(probably from '92 until late late 90s, maybe some into the 2000's) Had a portion of the BIOS on the drive itself, there for you basically couldn't do anything without the original drive... You could, however, add a 2nd drive to the computer.
Another thing, XP isn't very swapable... The drive would work, but you would probably have to reload XP...