How do I do it? I would like to save it to my hard disk and access it later.

...

public static void main (String args[]){

//Create the Document object
Document mapDoc = null;

//????? How to save? ????