diff --git a/loggerplugins/JUnitLogger/JUnitLogger.cc b/loggerplugins/JUnitLogger/JUnitLogger.cc
index 46e8f7839bfa323602821384f9a9a9afcb92d80a..4d72bccc2bed3d2ce8d7e063a4816aa2ffe1d829 100644
--- a/loggerplugins/JUnitLogger/JUnitLogger.cc
+++ b/loggerplugins/JUnitLogger/JUnitLogger.cc
@@ -177,7 +177,7 @@ void JUnitLogger::log(const TitanLoggerApi::TitanLogEvent& event,
         (now - then) / 1000000.0,
         verdict_name[tct.verdict()],
         (tct.reason().lengthof() > 0 ? ", reason: " : ""),
-        (const char*)tct.reason());
+        (const char*)escape_xml_element(tct.reason()));
 
       fprintf(file_stream_, "  <testcase classname='%s' name='%s' time='%f'>\n",
         (const char*)tct.name().module__name(),
diff --git a/loggerplugins/JUnitLogger2/JUnitLogger2.cc b/loggerplugins/JUnitLogger2/JUnitLogger2.cc
index afbf88bc42f065d06b80054fc1015a9360727982..a8e81bef440ac0499704f427c4074908da25f869 100644
--- a/loggerplugins/JUnitLogger2/JUnitLogger2.cc
+++ b/loggerplugins/JUnitLogger2/JUnitLogger2.cc
@@ -151,7 +151,7 @@ void JUnitLogger2::log(const TitanLoggerApi::TitanLogEvent& event,
 
         case TitanLoggerApi::TestcaseEvent_choice::ALT_testcaseFinished: {
           const TitanLoggerApi::TestcaseType& tct = tcev.testcaseFinished();
-          testcase.reason = tct.reason();
+          testcase.reason = escape_xml_element(tct.reason());
           testcase.module_name = tct.name().module__name();
           
           const TitanLoggerApi::TimestampType& ts = event.timestamp();