Okay, you do not have enough RAM so when it's used up, the system is going to freeze. When you restart, you are freeing up the RAM-until it's used up again. You should have at least 512MB to run Windows XP. I have a 7 year old desktop with Windows XP and I added RAM years ago, up to 512MB.
You could get another stick of memory and keep using the system. Go to this site download the scanner. Then type your computer make and model in. It will scan the system and tell you what type of memory it needs. But you need more info than just "it's 4 years old, an e-machine, windows xp."
To get this info: Control Panel> System> General tab> look for Model #
Confirm please: the power goes out. There are NO lights on the monitor, peripherals, keyboard, modem? The description is still not clear. You could be having a problem with the power source as mentioned, but I don't know just what "switch plug off" means. When you 'power cycle' a modem or router, you do disconnect the cables, leaving the power source off for a few seconds. But the system is actually ON before you do that even though it freezes.