Fix escaping of XML chars in the MI output.

Credits go to Razvan.