public String toXML() {
		String xml = null;
		
		try{
			Document document = DocumentHelper.createDocument();
            Element responseElement = document.addElement("response");
            responseElement.addAttribute("status", status);
            
            if(status.equals("200")){
            	if(items != null && !items.isEmpty()) {
            		Iterator<ContextItem> i = items.iterator();
            		while(i.hasNext()) {
            			ContextItem context = i.next();
            			if(context == null) {
            				continue;
            			}
            			Element itemElement = responseElement.addElement("item");
            			itemElement.addAttribute("subject", context.getSubject());
            			Element predicateElement = itemElement.addElement("predicate");
            			predicateElement.setText(context.getPredicate());
            			Element objectElement = itemElement.addElement("object");
            			objectElement.setText(context.getObject());
            		}
            	}
            }
            else if(message != null) {
            	Element messageElement = responseElement.addElement("message");
            	messageElement.setText(message);
            }
            
            xml = responseElement.asXML();
		} catch(Exception e){
			e.printStackTrace();
		}
		
		return xml;
	}