Well since you said it's a Compaq and almost all of those kinds of computers come with a restore cd for installing windows and stuff, like you mentioned, I'm assuming it's legal. Now what you wanna do is double check to see you're doing everything the right way. Here are some simple steps to reformatting so make sure you are doign it right:
1. Be SURE that it is in fact booting from your cd rom first, or the rom drive right your windows disc in it.
2. Wait for all the files to load and then press enter since you don't want to repair.
3. It should check to see if there are any other forms of windows already installed and there should be so just press enter (or ESC I don't remember which) on windows xp.
4. Once you have it will show you the partitions, you should have only one so it shouldn't be hard to find. Press D on that partition to delete it and then press L to confirm and enter so that it will create a partition in the largest size your hdd will allow.
5. Once you have, you should get an option to reformat that partition or it might do it automatically I can't remember, either way do reformat if it gives you the option.
6. Then your computer will reboot and then I suggest you enter your BIOS again to set the boot order to hdd first so it can finish installing windows on your hdd.
And that's pretty much it, all simple steps. My memory is a bit foggy on some of the parts so everything may not be exact, but should be close enough so you'll know what to do when you see it.