diff --git a/question/format/xml/format.php b/question/format/xml/format.php
index b50dae39b1a..2bad6ab24e4 100644
--- a/question/format/xml/format.php
+++ b/question/format/xml/format.php
@@ -1431,22 +1431,22 @@ class qformat_xml extends qformat_default {
foreach ($question->options->answers as $answer) {
$percent = 100 * $answer->fraction;
- $expout .= "\n";
+ $expout .= " \n";
// The "" tags are an added feature, old files won't have them.
- $expout .= " {$answer->answer}\n";
- $expout .= " {$answer->tolerance}\n";
- $expout .= " {$answer->tolerancetype}\n";
- $expout .= " " .
+ $expout .= $this->writetext($answer->answer, 3);
+ $expout .= " {$answer->tolerance}\n";
+ $expout .= " {$answer->tolerancetype}\n";
+ $expout .= " " .
$answer->correctanswerformat . "\n";
- $expout .= " " .
+ $expout .= " " .
$answer->correctanswerlength . "\n";
- $expout .= " format($answer->feedbackformat)}>\n";
+ $expout .= " format($answer->feedbackformat)}>\n";
$files = $fs->get_area_files($contextid, $component,
'instruction', $question->id);
- $expout .= $this->writetext($answer->feedback);
+ $expout .= $this->writetext($answer->feedback, 4);
$expout .= $this->write_files($answer->feedbackfiles);
- $expout .= " \n";
- $expout .= "\n";
+ $expout .= " \n";
+ $expout .= " \n";
}
if (isset($question->options->unitgradingtype)) {
$expout .= " " .