One feature I would love to see in the MoodleXML format is for it to preserve categories that are empty. Currently the scheme to list category path names, followed by questions within that category:
<question type="category">
<category>
<text>$course$/ParentCategory/SubCategory/CategoryNumberOne</text>
</category>
</question>
<question type="cloze">
<name>
<text>QuestionName</text>
</name>
<questiontext>
<text>QuestionTextHere {1:MULTICHOICE:choiceA~choiceB~=choiceC~choiceD} moreTextHere.</text>
</questiontext>
<generalfeedback>
<text></text>
</generalfeedback>
<shuffleanswers>0</shuffleanswers>
</question>
An inefficiency is that the categories are not always continuous, so that the first entry above (that gives the path for "CategoryNumberOne" may show up several times throughout the XML file. A more significant problem is that empty categories are not written at all. I have in the past created empty categories with the intent of "next term I'll add a unit on X, but I don't have time to write the questions now" only to find the categories missing from the newly-imported question bank the next term. It seems a more sensible way to write questions within categories would be like this:
<category name="ParentCategory">
<category name="SubCategory">
<category name="CategoryNumberOne">
<question> ...questionOne... </question>
<question> ...questionTwo... </question>
</category>
</category>
</category>
That should easily allow empty categories to be created, and should also help address the issue of categories being re-ordered upon import (see here http://moodle.org/mod/forum/discuss.php?d=147961). Apologies if this suggestion is naive, as I know next to nothing about coding PHP generally, nor the specific PHP used in Moodle's question import/export. But it just makes intuitive sense to me to utilize the hierarchical nature of XML to mirror the hierarchical nature of the question bank.
Dongsheng said he would probably be able to do this, so reassigning it with many thanks.