Yes, you can buy the upgrade version and for licensing purposes it's valid for replacing the same edition of an existing XP installation (i.e., XP Professional --> Windows 7 Professional).
If you have 32-bit XP and want to upgrade to Windows 7 32-bit, then you can use the upgrade kit to do an "upgrade in place" of your existing system which will preserve all your programs and settings.
If you have 32-bit XP and want to upgrade to Windows 7 64-bit, then you must use the upgrade kit to do a "clean install" which will require you reinstall all your programs and migrate all your data.