code: public void sendData(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
      {
          res.setContentType("text/xml");
          PrintWriter out = res.getWriter();
          this.printXML(req, out);
          out.flush();
      }
docs: Process an HTML get or post.
  You must override this method.
  @param req The servlet request.
  @param res The servlet response object.
  @exception ServletException From inherited class.
  @exception IOException From inherited class.