Temp save: two broken generate tests to fix, old code in comments, refactoring required, and possible recursive XML merge function to do.