diff --git a/question/format/xml/format.php b/question/format/xml/format.php
index <HASH>..<HASH> 100755
--- a/question/format/xml/format.php
+++ b/question/format/xml/format.php
@@ -498,7 +498,7 @@ class qformat_xml extends qformat_default {
     function import_category( $question ) {
         $qo = new stdClass;
         $qo->qtype = 'category';
-        $qo->category = $question['#']['category'][0]['#'];
+        $qo->category = $this->import_text($question['#']['category'][0]['#']['text']);
         return $qo;
     }
MDL-<I>:
Read xml structure correctly to get category path.

Merged from STABLE_<I>