if (arg instanceof HexBinary &&
destClass == byte[].class) {
return ((HexBinary) arg).getBytes();
} else if (arg instanceof byte[] &&
destClass == HexBinary.class) {
return new HexBinary((byte[]) arg);
}
// Convert between Calendar and Date
if (arg instanceof Calendar && destClass == Date.class) {
return ((Calendar) arg).getTime();