public void restoreFromFile(String fileName) throws Exception {
        File f = new File(fileName);
        if (!f.exists() || !f.canRead()) {
            throw new IOException(fileName + " could not be opened");
        }
        Document doc;
        try {
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            DocumentBuilder docBuilder = dbf.newDocumentBuilder();
            doc = docBuilder.parse(f);
	        if (!doc.getXmlEncoding().equals("UTF-8")) {
	            throw new KVException(new KVMessage("resp", "Unknown Error: Incorrect XML char encoding."));
	        }
	        NodeList nodes = doc.getElementsByTagName("KVStore");
	        if (nodes.getLength() != 1) {
	            throw new KVException(new KVMessage("resp", "Unknown Error: XML format incorrect"));
	        }
	        Hashtable<String, String> newstore = new Hashtable<String, String>();
	        // Restore K-V pairs
	        NodeList pairNodes = ((Element)nodes.item(0)).getElementsByTagName("KVPair");
	        Element pElem, kElem, vElem;
	        for (int i = 0; i < pairNodes.getLength(); i++) {
	        	pElem = (Element) pairNodes.item(i);
	        	kElem = (Element) pElem.getElementsByTagName("Key").item(0);
	        	vElem = (Element) pElem.getElementsByTagName("Value").item(0);
	        	newstore.put (kElem.getFirstChild().getNodeValue(), vElem.getFirstChild().getNodeValue());
	        }
	        store = newstore;
        } catch (IOException ioe) {
            throw new KVException(new KVMessage("resp", "I/O Error during restoreFromFile"));
        } catch (SAXException se){
            throw new KVException(new KVMessage("resp", "XML Error during restoreFromFile"));
        } catch (IllegalArgumentException iae) {
            throw new KVException(new KVMessage("resp", fileName + " is null..."));
        } catch (ParserConfigurationException pce) {
            throw new KVException(new KVMessage("resp", "Unknown Error: ParserConfigurationException"));
        }
        return;
    }