Instead of trying to understand every path which needs <code>xml_recover(vmxml_backup)<code>, it's better to use exceptions.  Wrap all the code which needs protecting inside a <code>try</code> and stick recovery code inside a <code>finally</code>.