At this point, there are essentially no options to “upgrade” from Windows XP.
Changing from XP to any version of Windows newer than Vista requires a clean install (Microsoft calls this a custom install).
Furthermore, the only version of Windows that remains available as a retail version is Windows 10 (end of retail sales of Windows 8.1 was September 1, 2015, so there may well still be inventory available). There are OEM and “System Builder” editions of some pre-Windows 10 versions still available, but generally these editions — although widely sold on the Internet — are not supposed to be used by “end users” on their own systems.
In addition to the problem of obtaining the correct software to install, you would have to worry about whether the hardware in your old computer will work with a newer version of Windows. The very first step would be to go to the web site of your computer’s manufacturer and see if there are drivers available for versions of Windows newer than XP.
I suspect that the newest version of Windows for which your computer will have drivers is Windows 7. If you decide to buy a copy of Windows 7, be very careful from whom you buy. Counterfeits abound and many will appear to install with no problems only to fail a Microsoft validation check weeks or months later.