redefine xdr functions consistently