title: twisted.web.resource.Resource with twisted.web.template.Element example
body: <p>I want to use twisted.web templates together twisted.web resources.</p>
  
  <p>But I just don't get, how to make them work together. </p>
  
  <p>I tried using, <code>flatten(request, MyElement(), request.write)</code>, but it ends up throwing an exception: <code>Request.write called on a request after Request.finish was called.</code></p>
  
  <p>Could someone provide me a very basic example how to use the two classes together?</p>