I have done exactly this in the way Paul describes with sessionScope variables and it works well.
Another alternative is to call a function, passing in the values you want, and this function creates the document and sets the values on the document based on the values you passed in.
Also, like with sessionScope variable, you could use a requestScope variable which is a little more efficient for what you are trying to do....
"The requestScope variables last for the duration of the request. This means the variables will last for the duration of a url request from the server. The variable can exist across XPages i.e. if an XPage is requested from another XPage. The requestScope variables are useful for variables which can be deleted straight after the value is submitted to the server. This means that there is not extra memory being used to store variables that are no longer needed."