MTR xml result must show the same result as MTR prints to stdout.
in case of retry-pass or retry-fail test result should be recorded in xml as failed.
if test failed on 1st attempt and passed on 2nd and 3rd it should be recorded in xml as failed. MTR does the same for stdout output and sets exit code accordingly.
I see 2 ways for it:
1 - do not update failed test result if test is already counted as failed
2 - count all attempts and choose worst case for xml