Some thoughts, though ... xp/windows is not my forté/fav ...
You re-installed everything, so...exclude a virus
(well, there is a debate werther windows itself
is a virus
but that aside). By the way, a modern virus will keep your system going, as shutting down is "leaving a trace" of its presence and it would disrupt it's own job.
The question is : who/what shuts the pc down
? If it's the os, then you'll not get any restore messages at reboot, if it is the hardware (heat/electrical/...) the os would not have the time to cleanly unmount/shutdown and that would manifest itself in some parts of the system. In w98 (yes, it's that long ago I used windows) there was the disk check (blue screen) ...