Connecting XBee3 with ESP32

I currently want to connect an XBee3 SMT module to an ESP32 via UART. I need a code example and pin configuration for this as i was incapable of figuring it out. The controller is attached to an RFID RC522 and i want to send tags messages from ESP to XBee module and print them

That is not something that Digi has any example code for. I would suggest checking with the RFID RC522 or ESP32 manufacture for the code you are looking for.