private static void writeFile(List<Office> offices, String stateName, String dest) {
		for (Office office : offices) {
			String key = office.getPinCode() + office.getName();
			if(offMap.containsKey(key)) {
				System.out.println("Duplicate::::"+office.getName() + ":::::" + office.getPinCode() + ":::::" + office.getLocation());
			} else {
				offMap.put(key, office);
			}
		}
		if (offices.size() > 3499) {
			List<List<Office>> partition = new ArrayList<List<Office>>();
			List<Office> subOffices = new ArrayList<Office>();
			boolean flag = false;
			int i = 1;
			for (Office office : offices) {
				subOffices.add(office);
				if (i == 3500) {
					partition.add(subOffices);
					subOffices = new ArrayList<Office>();
					i = 1;
					flag = true;
				} else {
					i++;
					flag = false;
				}
			}
			if (!flag) {
				partition.add(subOffices);
			}
			i = 1;
			for (List<Office> list : partition) {
				String tempStateName = stateName + "_" + i;
				createXML(list, tempStateName, dest);
				i++;
			}
		} else {
			createXML(offices, stateName, dest);
		}
	}