Thank you Tim. Interesting information. What actually happened is that despite religiously saving my files, there was no backup of the previous save. Lectora crashed for no apparent reason and in so doing destroyed the current XML codes (or at least corrupted them – toward the end I suspect, as you said). So I had nothing to compare against except a version many hours older. In the end, I was “saved” by my automatic backup to the cloud (pcloud.com) which although it had backed up the corrupted version also maintains what it calls a “rewind” service where it stores previous versions for several hours. I was able to retrieve a working version of the file minus about 1 hour of my latest work. That enabled me to rewrite the code in a fairly short time and without too much heartache. Of course, it did not solve the XML problem (i.e. why did it happen at all?).
I had hoped that there might be some set process for fixing the XML files if something went wrong but it seems that there is not.