users@jersey.java.net

Controlling name of outermost tag when returning a list?

From: Moises Lejter <moilejter_at_gmail.com>
Date: Tue, 6 Oct 2009 11:55:10 -0500

Given this example:

---cut here---
@XmlRootElement(name="item")
public class Value {
  public int id;
}

@Path("/list")
public class Lister {
  @GET
  public List<Value> values() {
    return
      Collections.singletonList(new Value());
  }
}
---cut here---

I expected the returned list to have its outermost tag set to "items"
but I get:

<values>
  <item>
    <id>0</id>
  </item>
</values>

Is there a way to change that "values" to "items" ?

Thank you!

Moises