Im using Jersey to build a REST Service and want to return a Collection as XML.
Collection
@GET @Produces(MediaType.TEXT_XML) @Path(\"/direct
Use
List list = new ArrayList(); GenericEntity> entity = new GenericEntity>(list) {}; Response response = Response.ok(entity).build();
The Generic entity wrapper works to get the output when using the Response builder.
Reference