DocMerge fails when data contains an ampersand

We have Word documents as templates for DocMerge.

The merge produces DOCX files that Word cannot read.

Some versions of Word give a helpful error message that specifies an illegal character in word/document.xml

Unzipping the DOCX and viewing the XML file shows data from Sugar as just "&" rather than encoded "&" which is how ampersands look from the template itself.

This sounds like a problem that people must have already found and fixed.

If we change the "&" in Sugar to "and" and try the DocMerge, it works correctly and the document shows in Word.

If we then change back to "&" and try again, it again produces an "illegal" document