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