Xbee + Arduino = Chat Devices

Xbee Sender sends a string (e.g., 'hello?') to the receiver.

Xbee Receiver Code on Mega:

#include <SoftwareSerial.h>
const int xb_rx =10;
const int xb_tx =11;
SoftwareSerial xbee(xb_rx,xb_tx); 
void setup() {
  Serial.begin(9600);
  xbee.begin(9600);
} 

void loop() {
  //xbee.write(255);
  
  if (xbee.available())
  {
    Serial.write(xbee.read());
  }

}

Can the receiver sends the data (e.g., 'yes?') back to the sender? If yes, any suggestions to write the code? Many thanks!

Your xbee object's type is SoftwareSerial which has several methods including print() and println().
https://www.arduino.cc/en/Reference/softwareSerial

Will the

xbee.print(analogvalue);

send the analog reading from a sensor back to the other Arduino via xbee?