Converting byte data to hex and then Sending HEX values via Arduino serial

Thanks for the reply. I tried the following code

char x;

  for (int i = 0; i < payloadLength; i++)
  {

    x = payload[i];
    if ( (x>='0' && x<='9')? (x-'0'):((x>='A' && x<= 'F')?((x-'A')+10):(0)) )
    
    {
      Serial.write(x);
    }

}

But it still sends '46' for the received char 'F' and '42' for character 'B'. I need to send '15' for the received char 'F' and '11' for 'B'.