Wiping out XP and installing Ubuntu will make it faster. However, formatting it and re-installing XP should also make it faster. If you don't feel like re-installing the OS, then you could try the following:
First of all check if your computer is infected or not. If it is, use Malwarebyts' and a good up-to-date antivirus to get rid of them. Here is a good guide on virus and malware cleanup: http://internet.helium.com/how-to/12032-how-to-clean-a-virus-infected-computer
After you are sure your computer is clean, do the following:
1. Increase RAM if your computer has the capability
2. Uninstall software you never use via the Control Panel - Add/Remove Programs
3. Clean up junk files (e.g. temp files, browser cache)
4. Clean the registry
5. Sort through your startup items - there might be things like Windows Live messenger starting on every computer boot, which slows down the computer. You can always start that messenger manually
6. Defrag hard drives
You can do all this manually or using a combination of free tools like CCleaner, Revo uninstaller, Auslogics Disk Defrag etc. Also you could get an optimization suite like BoostSpeed, where you can do it all and more from one program. Links below.