Added code to deal with hex encoded documents received from OpenXDS.