Rework XDR encoding