title: Choose between 2 different MarshallingHttpMessageConverter instances based on path or parameter
body: <p><strong>Scenario</strong>:</p>
  
  <p>In a Spring MVC controller (within a SpringBoot 1.2.5 microservice) I have an endpoint which returns a <code>JAXBElement&lt;?&gt;</code> which is marshalled to XML via a configured <code>MarshallingHttpMessageConverter</code> bean.  This works perfectly fine and currently does not perform validation against any schemas - it just spits out an XML representation of a domain object.</p>
  
  <p><strong>Problem</strong></p>
  
  <p>What I would like to be able to do on a per-request basis is specify whether validation should be performed during marshalling, so I can report any problems to the client - but still have the option to simply marshall with no validation.  Modifying the underlying <code>Jaxb2Marshaller</code> to do the validation is no problem, I just set the appropriate schema with <code>setSchema</code> and it works.</p>
  
  <p>Given that <code>MarshallingHttpMessageConverter</code> works with a single marshaller instance that is either configured to validate or not, and content negotiation is based on the accept header, how can I modify the setup to facilitate <em>selective</em> validation per request (based on a query parameter or path) - preferably whilst still relying on Spring's content-negotiation magic to do the 'hard work'?</p>