Maybe. Depends whether your computer's hardware meets at least the minimum requirements for Win7.
However, keep in mind that Microsoft is discontinuing support for all operating systems other than Windows 10, so even if you do switch to Windows 7 you won't get much, if any, support from Microsoft (including updates, etc.)
If you still decide to go ahead with this, I would recommend doing a fresh installation, not an upgrade. If you upgrade you'll only be able to upgrade to the 32bit version of Windows 7, which isn't going to work very well. Doing a fresh installation you can use the 64bit version of Windows 7, allowing you to use more than 2.5GB of RAM that a 32bit operating can use. You'll need way more RAM for Windows 7 which is why I recommend the 64bit version.
Just be warned, a fresh install will completely wipe your hard drive. So you might want to buy a 2nd hard drive for your computer, use that for Windows 7. Use your XP drive as a data drive. You can still access your files (but not your applications)