is it shutting down or rebooting. its possible a program could be crashing your system and forcing an instant reboot.
Try disabling the reboot portion by
right click on my computer. then goto properties
goto advanced tab and click on the settings under startup and recovery. Uncheck Automatically restart.
If your system is actually crashing it wont restart but show the BSOD (yes it exists in xp) with crash details