This [servlet or jsp] must return an XML document [for future processing by my web-app].
That is not intended for end-users.
What is a better design: write a JSP or an XML ?
p.s. What I don’t like about jsp is that every system admin can see your java code.
p.p.s If that’d be a jsp, than it must be capable to be autowired by Spring. Is it as easy to do as with servlets?
I would use a servlet for this in combination with a Javabean-to-XML serializer, such as XStream, XMLBeans, etc.
XStream is pretty easy:
No need to hassle with template text, so also no need for JSP.