title: XMLRootElement converting a class to XML in jersey
body: <p>I'm very good in converting a model class to JSON Array or Object. </p>
  
  <p>But i'm a noob when it comes to XML.</p>
  
  <p>I want my final output to be like this</p>
  
  <pre><code>&lt;Response&gt;
  &lt;Say voice="alice"&gt;Thanks for trying our documentation. Enjoy!&lt;/Say&gt;
  &lt;/Response&gt;
  </code></pre>
  
  <p>To achieve it i create a model class </p>
  
  <pre><code>@XmlRootElement(name = "Response")
  public class Response {
  
      private Say say = new Say();
  
      public Say getSay() {
          return say;
      }
  
      public void setSay(Say say) {
          this.say = say;
      }
  
      @XmlRootElement(name = "Say")
      static class Say {
  
          @XmlAttribute
          private String voice = "alice";
  
          private String string = "Thanks for trying our documentation. Enjoy!";
  
          public String getString() {
              return string;
          }
  
          public void setString(String string) {
              this.string = string;
          }
      }   
  }
  </code></pre>
  
  <p>Now after converting it to XML with jersey my output was </p>
  
  <pre><code>&lt;Response&gt;
  &lt;say voice="alice"&gt;
  &lt;string&gt;Thanks for trying our documentation. Enjoy!&lt;/string&gt;
  &lt;/say&gt;
  &lt;/Response&gt;
  </code></pre>
  
  <p>I got a extra string tag. I'm not sure what attribute to set for the String so that it comes in the body.? Or is there any other way?</p>
  
  <p>Also for say. The 'S' is not capitalised. How can i make it a capital letter?</p>
  
  <p>Thanks in advance</p>