That never happened to my X...do a factory reset on it and wipe cache too. Hopefully that will fix it. Boot into recovery by holding Home + Power.
When the triangle appears, then hit the Search button.
Navigate down to wipe data/factory reset, select it with camera, say “yes.” Do that and wipe cache while your at it. I did that when I got my used X off Ebay.
I hate to have to tell you this but it sounds like your processor is overheating. I'm far from an expert; but my Dad's did the same thing. Only it would reboot over and over again. Until I did a battery pull and then let it cool down and then reboot it. It would work fine for awhile and then it would start rebooting over and over again. But again, I'm no expert.