First step is to hit f8 when you first turnon computer, then go to (safe mode)
to try and solve your problem is to make the error actually readable. Open your system properties, click the advanced tab and then the settings button under startup and recovery. Uncheck 'Automatically Restart' and OK all of the open windows. Next time a stop error is generated you should be able to see it now. (Write the error code down and the someone can debugged it errors will look like 0x000000007 for exsample.)
Stop errors can be caused by a variety of things such as faulty hardware, bad device drivers, overclocking/over heating issues or software trying to do things it shouldn't or is not allowed to under Windows XP.