title: Spring RestTemplate and XMLStream use with List of Objects
body: <p>I am trying to use <code>Spring RestTemplate</code> to retrieve a List of Employee records, such as:</p>
  
  <pre><code>public List&lt;Employee&gt; getEmployeesByFirstName(String firstName) {   
  return restTemplate.getForObject(employeeServiceUrl + "/firstname/{firstName}", List.class, firstName);
  }
  </code></pre>
  
  <p>Problem is that web services (being called), returns the following XML format:</p>
  
  <blockquote>
    <p>&lt;employees&gt;  &lt;employee&gt;    ....  &lt;/employee&gt; 
    &lt;employee&gt;    ....  &lt;/employee&gt; &lt;/employees&gt;</p>
  </blockquote>
  
  <p>So when executing method above, I get following error:</p>
  
  <pre><code>org.springframework.http.converter.HttpMessageNotReadableException: Could not read [interface java.util.List]; nested exception is org.springframework.oxm.UnmarshallingFailureException: XStream unmarshalling exception; nested exception is com.thoughtworks.xstream.mapper.CannotResolveClassException: **employees : employees**
  </code></pre>