title: MessageBodyWriter most suitable Variant
body: <p>The <code>MessageBodyWriter.writeTo</code> method includes <code>MediaType mediaType</code> and <code>MultivaluedMap&lt;String,Object&gt; httpHeaders</code>.</p>
  
  <p><code>mediaType</code> is supposed to be the most appropiate output format, but how is it being selected when multiple <code>Accept</code> header values are included (i.e. <code>application/xml, q=0.5; application/json, q=0.9</code>).</p>
  
  <p>Besides, how is the best variant selected (language, etc.)? Using <code>Request.selectVariant()</code> is possible to do it automatically, but I haven't found how to do so within the <code>MessageBodyWriter</code>.</p>
  
  <p>Thanks</p>