code: private void writeDocument(String fullDocument, String filename) {
  		// create output file handle
  		File outFile = new File(mOutputDir, filename+".xml"); 
  		
  		BufferedWriter bw = null;
  		try {
  			// create a buffered writer for the output file
  			bw = new BufferedWriter(new FileWriter(outFile));
  			bw.append(fullDocument);
  			
  		} catch (IOException e) { // something went wrong with the bufferedwriter
  			e.printStackTrace();
  			Logger.printError(component, "File "+outFile.getAbsolutePath()+" could not be written.");
  		} finally { // clean up for the bufferedwriter
  			try {
  				bw.close();
  			} catch(IOException e) {
  				e.printStackTrace();
  				Logger.printError(component, "File "+outFile.getAbsolutePath()+" could not be closed.");
  			}
  		}
  	}
docs: writes a populated DOM xml(timeml) document to a given directory/file
  @param xmlDoc xml dom object
  @param filename name of the file that gets appended to the set output path