$ emacs -q

Create an XML buffer with the following:

<foo>
  <!-- comment -->
</foo>

Now C-x h M-; to comment out everything. Text becomes this:

<!-- <foo> -->
<!--   <\!-- comment -\-> -->
<!-- </foo> -->

which is not valid XML. This is even suggested by the mode itself. "<\!--" should be "<!-\-" instead. Uncommenting should also take that into account.

Version: GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.9) of 2015-03-03

Paul