One thing that can cause this is a clogged up CPU heat sink, filled with dust, the CPU gets too hot and the system shuts down. The system is set to restart on failure, so it reboots, over and over.
Another thing is a virus which causes the system to boot over and over, there are some malwares that cause this.
Another thing is a driver or software that you may have recently installed causing a memory dump and shutdown.
You may want to try system restore, setting the system back to the time before the problem started.
Another thing is just a system file error. A good place to start is cleaning out the heatsink, another thing is to reload XP as a repair install.
You may be thinking that if the system restarts over and over, how do I scan for a virus, or do other troubleshooting? That can be difficult if the system shuts off in the middle of your scan.
Take the drive out and put it in another computer that has functional XP. You can use the functional system to scan a defective drive, if there is no other way.
Buy a high quality antivirus disk. Put the disk in the drive and start the computer. Make sure the internet is connected. A good anti virus disk can connect, update, scan and neutralize a virus, without ever starting windows. Two systems that do this are Norton 360 and Panda Internet Security, there may be others available.