in dev/php8, when exporting to xlsx or docx we are seeing root> after some fields.
In particular for docx, we were to solve it in the file /var/www/html/ca/app/printTemplates/summary/docx_summary.php adding an extra preg_replace with
$textrun->addText(
preg_replace("/\~root\~(>)/", "",
preg_replace("![\n\r]!", "<w:br/>", caEscapeForXML(html_entity_decode(strip_tags(br2nl($display_text)), ENT_QUOTES | ENT_HTML5)))
),
$styleContentFont
);
when the field is obtained and added to the docx.
But since the same behavior is observed in the xlsx, maybe it worth to fix it deep. Or at least understand how to avoid it.