You cannot downgrade from Window 7 or Vista to XP , only upgrade from XP to Windows 7 or Vista.
If you wish to install XP on your system, you will have to do a full format and completly wipe the hard drive, before you can commence.
XP can use (I believe) 3.4GB of memory, however if you have more memory installed it will not do any harm.
As you have 4gb of memory I assume this is a 32bit machine, and 4gb is the maximum that a 32 bit machine can use.
I hope this helps