actually, if you have microsoft automatic updates turned on, there is no telling what surprise changes will be made, or what will suddenly occur, and there are all kinds of malfunctions related to these updates. and so I am suggesting you repair install XP, without reformatting the drive, turn ms auto update off, do not install any updates. see if the log off problem stops,which I am guessing it may. If you are using a good anti virus, it really turns out that these updates are unnecessary. And as crazy as it may sound, it seems that the most stable systems are the ones that don't install the updates.
another thing is to start checking the event log to see what occurs just before the log off occurs.
Then for those who turn off auto update, install microsoft power toys, tweek IU, which allows you to turn off the message balloons, claiming that your system is at risk because ms update is turned off.