title: Unable to position XML Attributes at proper location of my Java created XML Object
body: <p>This is the XML output I currently get:</p>
  
  <pre><code>&lt;parameter&gt;
    &lt;dataIdentifier&gt;123&lt;/dataIdentifier&gt;
    &lt;newValue encoding="base64"&gt;
       &lt;value&gt;NjUw&lt;/value&gt;
    &lt;/newValue&gt;
  &lt;/parameter&gt;
  </code></pre>
  
  <p>And this is the XML output I want to have:</p>
  
  <pre><code>&lt;parameter&gt;
    &lt;dataIdentifier&gt;123&lt;/dataIdentifier&gt;
    &lt;newValue encoding="base64"&gt;NjUw&lt;/newValue&gt;
  &lt;/parameter&gt;
  </code></pre>
  
  <p>Here are my Java classes so far:</p>
  
  <pre><code>@XmlRootElement(name = "parameter")
  public class Parameter {
  
      private Integer dataIdentifier;
      private ParameterValue newValue;
    ..
  }
  
  @XmlRootElement
  @XmlAccessorType(XmlAccessType.FIELD)
  public class ParameterValue {
  
      @XmlAttribute(name="encoding") 
      private String encoding;
      private String value;
    ..
  }
  </code></pre>
  
  <p>I am sure there is an easy solution for my problem. Unfortunately I do not have any idea about JAXB annotations.
  I already invested a few hours but I can't find a way to do it. Can someone please show me how to solve this?</p>
  
  <p>Thanks </p>