title: Serialize a Java object using JAXB
body: <p>I have the following two classes hierarchy:</p>
  
  <pre><code>@XmlAccessorType(XmlAccessType.FIELD)
  @XmlType(name="Dictionary",propOrder={"description"})
  public class DictionaryDto implements Serializable, Descriptionable {
  
      private static final long serialVersionUID = 1L;
  
      @XmlAttribute(required=true)
      private String id;
  
      @XmlElement(name="Description")
      private String description;
  
      public DictionaryDto() {
      }
  
      public DictionaryDto(String id, String description) {
          this.id = id;
          this.description = description;
      }
  
      //getters and setters follows...
  }
  
  public class DictionaryProvinceDto extends DictionaryDto {
  
      private String code;
      private static final long serialVersionUID = 1L;
  
      public DictionaryProvinceDto () {
          super();
      }
  
      public DictionaryProvinceDto (String id, String description, String code) {
          super(id, description);
          this.code= code;
      }
  
      //getters and setters follows...
  }
  </code></pre>
  
  <p>where Descriptionable is an interface declaring the only method <code>String getDescription()</code></p>
  
  <p>I am trying to serialize in XML an object of type DictionaryProvinceDto but I am getting</p>
  
  <pre><code>&lt;Province id="030"&gt;
      &lt;code&gt;AN&lt;/code&gt;
  &lt;/Province&gt;
  </code></pre>
  
  <p>Desired output: </p>
  
  <pre><code>&lt;Province id="030"&gt;
      &lt;code&gt;AN&lt;/code&gt;
      &lt;description&gt;my funny province&lt;/description&gt;
  &lt;/Province&gt;
  </code></pre>
  
  <p>Does anybody can explain why I don't obtain what I expect?</p>