I robotically edited the config file by using a program that applies regex-based search-replace operations on the XML to change things like IPv4 addresses per modem, and n-th modem index numbers 1,2,3,4 where needed to make them correct per-modem, that kind of thing. I then checked the output by diff-ing the output against the original, so as to make sure that the program had not only done the right thing where it was supposed to but had also not gone ‘rogue’ and applied any changes anywhere else where it shouldn’t due to a false accidental match. The edit operations used complex ‘context’ regexes to strictly limit edit sites down to where they are supposed be, only in the right XML context. So I was quite paranoid about the likelihood of bugs.
The modems refer to per-modem addresses 192.168.n.1 and 192.168.n.254, where n is 1…4, and .n.1 is the modem’s admin interface looking towards the Firebrick and .n.254 is the Firebrick’s modem-facing interface. That is one example of a systematic change that is straightforward.