InternalValue value;
if (reqType != PropertyType.DATE) {
// type conversion required
Value targetVal = ValueHelper.convert(
new DateValue(date), reqType,
ValueFactoryImpl.getInstance());
value = InternalValue.create(targetVal, session.getNamespaceResolver());
} else {
// no type conversion required
value = InternalValue.create(date);