I am using Jaxb2Marshaller as a view property for ContentNegotiatingViewResolver. I am able to get the xml repsonse. How do I format (pretty print) it?
Try setting this property on your marshaller object:
marshaller.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE )
Here is the full Javadoc for the Marshaller interface. Check out the Field Summary section.