case PropertyType.DATE:
return new DateValue((Calendar) val);
case PropertyType.DOUBLE:
return new DoubleValue((Double) val);
case PropertyType.LONG:
return new LongValue((Long) val);
case PropertyType.REFERENCE:
return ReferenceValue.valueOf(((UUID) val).toString());
case PropertyType.PATH:
try {
return PathValue.valueOf(((Path) val).toJCRPath(nsResolver));