The container adds the xml declaration when you don't use jsp:root as the top element of your JSP document. You can control this behavior by using the jsputput action with the omit-xml-declaration property set to "yes" or "true"
So there are 2 solutions for your problem. 1. Use jsp:root 2. Use the jsputput as