Have you got any shared folders that the Windows and XP systems can both see?
It's entirely possible that files on those folders could be infected, it's also possible that the infected files
could have been passed to the Ubuntu system (although, of course, the Ubuntu system wouldn't have suffered as a result).
For that reason my suggestion (as severe as it may sound) would be to completely rebuild
both operating system. No point rebuilding Windows and restoring Grub only to find that you've got a nasty file hiding in the Ubuntu/shared partition that then gets back onto your Windows install and borks it all over again