Classes with XmlRootElement can be unmarshalled from XML elements simply by invoking the unmarshal method that takes one parameter. This is the simplest mode of unmarshalling. Unmarshalling with @XmlRootElement @XmlRootElement class Foo { @XmlAttribute String name; @XmlElement String content; } Unmarshaller u = …; Foo foo = (Foo)u.unmarshal(new File(“foo.xml”)); foo.xml <foo name=”something”> <content>abc</content> </foo> However, sometimes you may need to unmarshal an instance of a type that does not…