private void writeDocument(Document doc) throws AccountPersistException{
		Writer out = null;
		try {
			out = new OutputStreamWriter(new FileOutputStream(file), "utf-8");
			XMLWriter writer = new XMLWriter(out, OutputFormat.createPrettyPrint());
			writer.write(doc);
		} catch (IOException e) {
			throw new AccountPersistException("Unable to write persist data xml", e);
		}finally{
			
			try {
				if(out != null){
					out.close();
				}
			} catch (IOException e) {
				throw new AccountPersistException("Unable to close persist data xml writer", e);
			}
			
		}
		
	}