code for xbee full duplex communicatuon

Please provide me

The Digi XBee is a Half duplex product.

You can use only SPI protocol in full duplex mode.
https://www.digi.com/resources/documentation/digidocs/embedded/dey/2.4/cc6/yocto_r_apix-spi

https://www.digi.com/resources/documentation/Digidocs/90002126/reference/r_spi_full_duplex.htm?TocPath=Operation|Serial%20communications|SPI%20operation|_____3

As was said by mvut, the deivce is a half duplex device.
So you can only do Half Duplex with MicroPython. Do you want to transmit and receive to and from a TCP/IP server as a TCP/IP client? or the serial port? or Full Duplex SPI?