Returning HTML through an ajax-call in Drupal 8 I am trying to grasp the MVC/Symphony integraton of Drupal and am making use of the controllers. My controller has a function named "returnHTML" which is called by a normal XMLHttpRequest. Problem is I do not know how to generate the HTML. I could use a theme, but implementing a theme feels a little bit too complicated for this simple task. I want a HTML-fragment, ergo what you see is what you get, not a complete webpage. 

Is there a way to return HTML just specifying where a twig is and have this twig-file injected with data in the "returnHTML"-function immediately? Also is there a recommended class (like Symphonys JsonResponse) which will help with the headers?
Since we are fairly new in the Drupal 8 jungle I'll give some feedback how I fixed this. Be aware this is probably not the best solution. 

Using a controller I included this function:

    /**
     * Inspiration page action
     */
    function inspiration(){
        $twig = \Drupal::service('twig');
        $template = $twig-&gt;loadTemplate(drupal_get_path('module', 'experimental') . '/templates/inspiration.html.twig');
        echo $template-&gt;render([]);
        die;
    }


This works fine, allthough it is not very beautiful.