I suspect that i have malware on my laptop, since it is running very slowly lately and when i shut down i see a line of text for a split second just before my laptop shuts down. A scan reveals nothing.
Try ccleaner, malwarebytes, check your processes tab in task manager, and get rid of weird stuff and stuff you don't need in msconfig startup and services.
Does it do the same in safe mode? Installed anything recent ? something maybe too new for xp to handle, or did some changes?
Anything weird on eventviewer?