When i use drupal_add_http_header() in a module function,
and do an echo() or create some Xml with XmlWriter there is added some more extra html code.

I tried it with Drupal6 and Drupal7 were i can create a custom output without some of these extra stuff;-)

Any ideas if it is a know bug?

The extra html is the region content, rendered by drupal_region_class().

The other four regions help, sidebar_first, footer, page_top are not rendered. So i believe when Drupal 6 and 7 does not render region content in this case, Drupal 8 shouldn't rended it too.

I fixed this behaviour with hook_preprocess_HOOK()

function mymodule_preprocess_region(&$variables) {
   if(current_path() == "mypath") {
     unset($variables['content']);
   }
}

Anyone a better idea?