public void sendMessage(Socket socket) throws KVException {
		try {
			String xml = this.toXML();
			OutputStream os = socket.getOutputStream();
			os.write(xml.getBytes(), 0, xml.length());
		}
		catch (IOException e) {
			throw new KVException(new KVMessage("resp", "Network Error: Could not send data"));
		}
		catch (KVException e) {
			throw e;
		}
		catch (Exception e) {
			throw new KVException(new KVMessage("resp", "Unknown Error: " + e.getLocalizedMessage()));
		}
		
		try {
			socket.getOutputStream().flush();
		}
		catch (IOException e) {
			throw new KVException(new KVMessage("resp", "Unknown Error: Socket is not connected"));
		}
		
		try {
	    	socket.shutdownOutput();
	    }
	    catch (IOException e) {
	    	throw new KVException(new KVMessage("resp", "Unknown Error: " + e.getLocalizedMessage()));
	    }
	}