I tried again this morning and managed to get to the log on screen with the same blue screen and resulting shutdown. I managed to read the error message on the blue screen that time and know that I need to reinstall XP.
I went into the BIOS and made sure that I am booting from the CD. I then put the XP CD into the drive and turned the laptop back on. The screen came on with the HP logo and the message saying press ESC to change boot order and press F2 to entre setup. It then froze. I have tried starting the laptop without the CD and with it and everytime it freezes at the same point.
Any help would be greatly appreciated.