I've successfully done similar - but I'm guessing a Sony laptop might need some specific drivers (for stuff like soundcard), so it won't be 100% straight forward.
Switching from XP to 7 is usually fine (seven actually used less resources) but there are usually some issues so check online first
Try a search like - upgrading sony laptop from xp to 7 - and then do some reading!