title: JAXBElement<T> make the declared type T as a parameter to work with any class
body: <p>I got this code</p>
  
  <pre><code>private Object fooMethod(Node node, Class classOut)
    JAXBElement&lt;MessageAcknowledgementType&gt; root = unmarshallerjaxObject.unmarshal(node, MessageAcknowledgementType.class);
  </code></pre>
  
  <p>Since I am going to call the fooMethod with different class names, I want to specify into the JAXBElement the name of the class from the variable classOut, I have tried this but it doesn't work:</p>
  
  <pre><code>JAXBElement &lt;classOut.getSimpleName()&gt; root = unmarshallerjaxObject.unmarshal(node, classOut.getSimpleName()); //It doesn't work
  </code></pre>
  
  <p>Any idea about how to specify the class name into the JAXBElement?. Thank you!.</p>