I can declare JAXB element in two ways:
@XmlElement
public int x;
or
private int x;
@XmlElement
public int getX(){...}
The use of @XMLElement (and similar annotations) before fields or before getters is well explained in this post: http://blog.bdoughan.com/2011/06/using-jaxbs-xmlaccessortype-to.html.
The following annotation before a class determines the XML bindings of fields/getters: