I've had this problem on my xp machine. The problem was my antivirus downloading updates which stopped the computer shutting off.
Another problem might be a windows error. You can try and fix this by using the recovery disc if you have one for xp?
There are a lot of problems that this could be unfortunately, a virus could be messing around with your pc, run a full system scan and see if that works.
My eventual fix was to reinstall xp completely and leave it at that...