If your XP system logs you on and logs you right off before starting windows you may have a missing
C:\windows\system32\userinit.exe file.  Copy it from another system and put it in the system your having trouble with.

You can either take the drive out of the existing system and put it in another XP system and copy it or you can extract the userinit.ex_ from the windows XP cd rom and get it in the system your having trouble with.

Easier said than done huh ? Well .... I found this fix by running a virus scan in safe mode and it removed the userinit.exe.  Then I booted the infected system with the CD and copied it from a floppy.  Good luck !