I need a compatible version of Ubuntu for my computer that has only 248 MB of RAM. Would it be possible to remove Windows XP?
You can see older releases here http://old-releases.ubuntu.com/releases/
There is a pretty new version 16.04.3 LTS x86 (http://old-releases.ubuntu.com/releases/16.04.3/ubuntu-16.04.1-desktop-i386.iso). For this one end of life is April 2021 (https://wiki.ubuntu.com/Releases).
If computer is very old and the OS will require to many resource, consider using Lubuntu with LXDE desktop (https://lubuntu.net/). You can even get 18.04 (http://cdimage.ubuntu.com/lubuntu/releases/18.04/release/lubuntu-18.04-desktop-i386.iso).
Considering it's likely an older or at least weaker system anyways, you may want to look into Lubuntu:
Lubuntu still has a 32 bit download for desktop even with 18.04, not sure what you're trying to use ubuntu for, but I'm pretty sure you can put other GUIs on it that will work with 32-bit, and this should still give you a good taste of ubuntu if you're still new to Linux/Ubuntu and it doesn't really have any bloat.
Edit in response to question edit:
I am curious what exactly you would want to use ubuntu for, I mean, you could try using an old ubuntu server 32-bit build which comes with no GUI by default if you're using it for something purely technical, but I'm not entirely sure where they house old ubuntu server builds, but even that might be pushing it on such a tight RAM budget. The best option with a graphical interface is still what I suggested earlier.