In case you need to produce a response shown as XML format using Spring you can just add to the @RequestMapping annotation the following:
@ResponseBody
@RequestMapping(value = "/url_mappin", method = RequestMethod.GET, produces = "application/xml")