ok...couple of things.

1. if the computer takes you to windows instead of booting to the xp cd...it's likely that you just need to change your boot order in the bios (usually holding down f2 when starting will give you this option) and then change cdrom to be higher in the priority list than the hd. If this method doesn't work, then it's likely the cd has gone bad and you won't be able to use it after the reformat.

2. You can't really format the hd while you are using the OS that it's running on. You have to boot from something else (cd, floppy disk, usb drive) with an application that can format the hd ( the xp cd should do this) but there are other free options as well:
http://www.killdisk.com/downloadfree.htm