You might find it preferable to put this kind of information in the header rather than the body. The function call you are looking at (AddCriticalFailureStack) is located in the body sequence, but it is probably not the best place to add this (first of all, because it's in the report body, and secondly, because it recursively generates each step/calling sequence to trace specific failures).
Probably the best place for this modification would be in AddReportHeader of reportgen_xml.seq in the step "Add Report Element". Notice that this is where the step count is being displayed, and that would therefore be an appropriate place for the failure count.
Additionally, note that typically when adding elements to XML reports, you need to
modify the style sheet as well as the xml generation
(<TestStand>\Components\User\Models\TestStandModels\StyleSheets).
Thanks,
Andy McRorie
NI R&D