Render Twig template as XML
I found a solution myself.

The problem is that Drupal's mail system converts HTML to plain text, and therefore strips all HTML tags.

A workaround to this is to replace all &lt; and &gt; characters with their unicode string and send the mail as text/plain.

I did like this:

$mail_message = [
  '#type' =&gt; 'theme',
  '#theme' =&gt; 'my_module_xml_mail',
  '#name' =&gt; 'Name',
  '#phone' =&gt; 'Phone',
  '#email' =&gt; 'E-mail',
];

$rendered = \Drupal::service('renderer')-&gt;render($mail_message);

\Drupal::service('plugin.manager.mail')-&gt;mail('my_module', 'xml_mail', 'test@example.com', 'en', [
  'message' =&gt; str_replace(['&lt;', '&gt;'], ['&amp;#60;', '&amp;#62;'], $rendered-&gt;__toString()),
]);