The above approach has a serious drawback anyway - namely, that it won't work for sub-sitemaps. They share the same session and would overwrite each other's session attributes.
Do you really need to use the session? Can't you store the "toSAX" function as a request attribute or as a bizData object?
Ugo
