It took me long enough to figure ... but it seems the error persist no matter what I do when using the classesToBeBound property.
I solved it using two steps on the client side.
1. Replace classesToBeBound property for contextPath property.
2. Replace MyObject.class for JAXBElement.class
<bean id="xmlMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller" >
<property name="contextPath" value="generated" />
MyObject obj = (MyObject) restTemplate.getForObject(restUrl, JAXBElement.class, word).getValue();
Note that both steps where necessary for my success. Finally, I got a contract-first REST service running
Although, I do think JAXB2 needs to address the @XMLRootElement annotation issue; and I do think spring documentation is failing since javadocs/spring-docs doesn't tell the difference between using classesToBeBound or contextPath when there obviously is a difference.