title: Spring MVC 3: Returning XML through @ResponseBody
body: <p>Pardon me for posting this noob question, but I have been debugging this problem for quite awhile now. I'm having a little problem trying to get the response to return the XML based on the object:-</p>
  
  <pre><code>@RequestMapping(value = "/mylink", method = RequestMethod.GET)
  public @ResponseBody SomeObject doIt() {
      ...
  }
  </code></pre>
  
  <p>Right now, even though that API is called, my client side does not receive the XML response at all. I have been reading a few places and it seems like I need to configure the XML marshaller or somesort of XML resolvers, but I'm not sure how to integrate that piece into my existing configuration. I currently have the following configuration in my servlet.xml:-</p>
  
  <pre><code>&lt;context:component-scan base-package="ss.controller" /&gt;
  
  &lt;mvc:annotation-driven /&gt;
  
  &lt;mvc:resources location="/resources/" mapping="/resources/**" /&gt;
  
  &lt;bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
      &lt;property name="prefix" value="/WEB-INF/jsp/app/" /&gt;
      &lt;property name="suffix" value=".jsp" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Can someone kindly post some sample configurations on how I might go about in configuring my servlet.xml to get this working? Thanks much.</p>