private String contextToXML(ArrayList<ContextItem> context) {
		if(context == null) {
			return null;
		}
		String xml = null;
		try {
			Document document = DocumentHelper.createDocument();
	        Element caseElement = document.addElement("case");
	        
	        Iterator<ContextItem> iContextItem = context.iterator();
	        while(iContextItem.hasNext()) {
	        	ContextItem item = iContextItem.next();
	        	String predicate = item.getPredicate();
	        	String object = item.getObject();
	        	if(predicate != null && object != null) {
	        		Element contextElement = caseElement.addElement("context");
	        		Element predicateElement = contextElement.addElement("predicate");
	        		predicateElement.setText(predicate);
	        		Element objectElement = contextElement.addElement("object");
	        		objectElement.setText(object);
	        	}
	        }
	        xml = caseElement.asXML();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return xml;
	}