XML file generation was breaking; the command's __del__() method wasn't being triggered.  So introduced a more robust mechanism.  Now a Command object has a stub method called finalise(), which gets triggered after recursion through the subhandlers.  This is similar to but distinct from execute(), which gets triggered before recursion.