You need a 64-bit operating system to take advantage of all that RAM. XP is 32-bit, which means it can only see 4 GB, and in addition, it loses part of that to the video card, so the most you'll get out of XP is a little over 3 GB.
You won't be able to upgrade directly from XP to Windows 7, both because that upgrade isn't supported in general, and also because you can't in-place upgrade from 32-bit to 64-bit. If you buy a boxed version of Windows 7 Upgrade (you probably want Home Premium) it'll come with both the 32 and 64-bit disks. However, if you buy OEM, make sure you get 64-bit because OEM only comes one way or the other.