Deserialise XML response with attributes and not wrapped collections
问题 I'm trying to deserialise an XML response from my RestTemplate and the response contains attributes that I need to set in my mapped object. The response is similar to: <schoolResponse> <class id="1" num_of_students="22" name="Ms Barry" > <student key="202" value="Jim" /> <student key="203" value="Tom" /> <student key="204" value="Dave" /> <schoolYear>1980</schoolYear> </class> <class id="2" num_of_students="20" name="Mr Smith"> <student key="302" value="Jim" /> <student key="303" value="Tom"