public static String toString(Object val) {
		if (val == null || val instanceof String)
			return (String)val;
		if (val instanceof Collection) {
			final StringBuffer sb = new StringBuffer();
			for (Object v: (Collection)val) {
				final String s = toString(v);
				if (s != null && s.length() > 0) {
					if (sb.length() > 0) sb.append(' ');
					sb.append(s);
				}
			}
			return sb.toString();
		}
		return val.toString();
	}