$ emacs -q Create an XML buffer with the following: Now C-x h M-; to comment out everything. Text becomes this: which is not valid XML. This is even suggested by the mode itself. "<\!--" should be "