I formatted the unwanted XP partition with the Windows7 install disk and installed Windows7 there successfully, but it did not sort out the boot manager and was the only system available at startup. Then booted the DVD again and selected Repair - It automatically brought up a "System Recovery Options" box with the message: "Windows found problems with your computer's startup options..." and I clicked the "Repair and restart" button. That set up my previous Windows7 system which was available in the startup menu as "Windows 7 (recovered)", but the XP system was not available.
I used EasyBCD to add the XP system and then change the target drive, going through each option in turn, and XP would not boot. I sort of expected that, from past experience of the illogic of drive letters and boot file allocations in XP-Windows7 multiboot, so I just copied the boot.ini, ntldr, and ntdetect files from the XP system into all the other partitions, and then it booted.
Then I was curious to understand where Windows wanted the boot.ini file to go. It turns out to be the most recent Windows7 installation, so I deleted the XP boot.ini, etc. files from everywhere else and it's fine. I still don't understand the logic of this - is it because the active Windows7 bootmgr file is there? There are also bootmgr, Boot.BAK, BOOTSECT.BAK, and grldr files in the XP partition - why the duplication? I would delete the surplus Windows7 boot files (if they really are surplus), but am reluctant to trash the setup I have now, unless someone can explain what's going on!