	public static void writeObject(XStream xStream, OutputStream os, Object obj) {
		try(OutputStreamWriter osw = new OutputStreamWriter(os, ENCODING)) {
			String data = xStream.toXML(obj);
			data = "<?xml version=\"1.0\" encoding=\"" + ENCODING + "\"?>\n"
					+ data; // give a decent header with the encoding used
			osw.write(data);
			osw.flush();
		} catch (Exception e) {
			throw new OLATRuntimeException(XStreamHelper.class, "Could not write object to stream.", e);
		}
	}