title: Spring inject XML unmarshalled entity
body: <p>I'm working on a Spring application and I'd like to know if there's any way I could specify in my configuration the path of an XML file, having it automatically unmarshalled into a Java object through JAXB (I may consider other libraries though) and then inject it into a bean.</p>
  
  <p>A Google search yields different results but they seem more about injecting a marshaller/unmarshaller in your bean and then doing the work yourself (like this one <a href="https://www.intertech.com/Blog/jaxb-tutorial-how-to-marshal-and-unmarshal-xml/" rel="nofollow noreferrer">https://www.intertech.com/Blog/jaxb-tutorial-how-to-marshal-and-unmarshal-xml/</a>) and I'm more interested in delegating this boilerplate to Spring.</p>
  
  <p>Thanks</p>