re> <code>

     &lt;!-- XML input --&gt;
     &lt;foo&gt;string&lt;/foo&gt;

     // Example: code fragment corresponding to XML input
     JAXBElement&lt;String&gt; o =
     (JAXBElement&lt;String&gt;)unmarshaller.unmarshal(aboveDocument);
     // print JAXBElement instance to show values
     System.out.println(o.getName());   // prints  "{}foo"
     System.out.println(o.getValue());  // prints  "string"
     System.out.println(o.getValue().getClass()); // prints "java.lang.String"

     &lt;!-- Example: