public ServerReply getReply(HttpPost post)  {
		ServerReply reply = null;
		HttpClient client = this.getClient();
		
		try  {
	    log.finest(String.format("[%s] Executing POST.", post.getURI()));
			HttpResponse resp = client.execute(post);
	    
			try  {
				HttpEntity entity = resp.getEntity();
				
				if(resp.getStatusLine().getStatusCode() == 200)  {
					InputStream in = entity.getContent();
					log.finest(String.format("[%s] Received HTTP code %d: %dbytes (%s)", 
							post.getURI(), 
							resp.getStatusLine().getStatusCode(), 
							entity.getContentLength(), 
							entity.getContentType().getValue()));
					
					Document document = this.builder.parse(in);
					Element replyElement = (Element)document.getFirstChild();
					Element contents = ElementUtils.getFirstElementByName(replyElement, "contents");
					
					/*
					 * Test the first element found within the element 'contents'. If the
					 * element's name is 'token', then this is a LoginReply. However, if the
					 * name of the element is 'reports', this will mean this is a ReportListReply.
					 * 
					 */
					Element firstElement = (Element)contents.getFirstChild();
					if(firstElement == null)
						reply = new ErrorReply(replyElement);
					
					else if(firstElement.getTagName().equals("reports"))
						reply = new ReportListReply(replyElement);
					
					else
						reply = new LoginReply(replyElement);
					
					log.finest(String.format("[%s] Parsed XML succcessfully: %s", post.getURI(), reply.getClass().getName()));
					
				}else{
					log.warning(String.format("[%s] Received HTTP code %d. Skipping parsing of content.", post.getURI(), resp.getStatusLine().getStatusCode()));
					EntityUtils.consume(entity);
				}
				
			}catch(IOException | SAXException | ElementNotFoundException e)  {
				log.warning(String.format("Could read/parse reply from server %s: %s %s", this.url, e.getClass().getName(), e.getMessage()));
				
			}
			
    }catch(IOException e)  {
    	log.warning(String.format("Could not connect to server %s: %s", this.url, e.getMessage()));
    
    }
		
		return reply;
	}