This topic has not yet been written. The content below is from the topic description.
19.3.1. @XmlHeader and @Stylesheet Sometimes when outputting XML documents you may want to set an XML header. Resteasy provides the @org.jboss.resteasy.annotations.providers.jaxb.XmlHeader annotation for this. For example: @XmlRootElement public static class Thing { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } } @Path("/test") public static class TestService { @GET @Path("/header") @Produces("application/xml") @XmlHeader(" ") public Thing get() { Thing thing = new Thing(); thing.setName("bill"); return thing; } } The @XmlHeader here forces the XML output to have an xml-stylesheet header. This header could also have been put on the Thing class to get the same result. See the javadocs for more details on how you can use substitution values provided by resteasy. Resteasy also has a convinience annotation for stylesheet headers. For example: @XmlRootElement public static class Thing { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } } @Path("/test") public static class TestService { @GET @Path("/stylesheet") @Produces("application/xml") @Stylesheet(type="text/css", href="${basepath}foo.xsl") @Junk public Thing getStyle() { Thing thing = new Thing(); thing.setName("bill"); return thing; } }