You can easily format an XML document into any other format via an XSLT stylesheet. You can even do it as a static page transformed directly in the browser with XSLT.
Find one of the many tutorials
- Parse your XML document to a DOM object in memory. http://www.java2s.com/Code/Java/XML/LoadinganXMLDocumentusingDOM.htm
- from the controller (the httpServlet) put this dom into the httpRequest.setAttribute("mydom",dom);
- write a XSLT stylesheet transforming the blast XML to the output of your choice. e;g; see my XSLT stylesheet http://code.google.com/p/lindenb/source/browse/trunk/src/xsl/xml2html.xsl .
- load this (stylesheet from the the httpServlet) and put it into the httpRequest.setAttribute("mystlesheet",xsl);
- redirect the request to your jsp
- on the JSP side, transform the XML document using the standard x:transform tag ( http://java.sun.com/developer/technicalArticles/javaserverpages/faster/ )
Have you looked at the built-in BLAST HTML output?
> blastn -help | grep -A1 html -html Produce HTML output? > blastn -version blastn: 2.2.24+ Package: blast 2.2.24, build Aug 12 2010 17:47:58
This applies not only to blastn but the other programs as well. There is also wwwblast for the older version of the NCBI tools.