The appropriate code (Arduino) of Xbee
I'd advise you to start by configuring the XBees in AT "Serial Wire" mode. This turns the XBees into a simple serial connection between the Arduinos. From that point on, you use  Serial.print()/Serial.write() and Serial.read() just as if the Arduinos were connected directly to each other by wires.

Let's name the XBees XBee_uno and XBee_mega for the following steps. You have most probably completed the first three already, but I'm writing them in full to help others who may have this question.


Use X-CTU to set both XBees to AT mode (this may necessitate a new firmware or function set, though Series 1 XBees I think only need the setting of one parameter )
Set both XBees to use the same PAN ID; set one to be coordinator and the other to be a router/end device. Again, you may need a firmware/function set update for this. It doesn't matter which one is the coordinator, as long as one is the coordinator and the other is a router/end device. 
Set the serial speed of both XBees to a known value, e.g. 9600bps, no parity, 8 data 1 stop bits


Now set them so that they send to each other. This completes the "Serial Wire" configuration.


From X-CTU read the SH and SL of each (i.e. the serial number high/serial number low)
For XBee_uno, set DH and DL to the value of the SH and SL respectively from the XBee_mega
For XBee_mega, set DH and DL to the value of the SH and SL respectively from the XBee_uno
Save the settings to the XBees.


At this point the XBees are configured to function as a virtual wire-pair between the serial ports of the Arduinos. 

Sample code:

//on the sender side
void setup() {
  Serial.begin(9600);//this has to match the serial speed you configured for the respective XBee
}
void loop() {
  Serial.write(20); //or the value you want to send   
}

//on the receiver side
int received;
void setup() {
  Serial.begin(9600);//this has to match the serial speed you configured for the respective XBee
}
void loop() {
  if (Serial.available()) {
    received=Serial.read();
  }
}


As an alternative for older XBees, you could read the MY address from each XBee and then set as follows:


For XBee_uno: set DH=0, DL = the MY from XBee_mega
For XBee_mega: set DH=0, DL = the MY from XBee_uno


This works with both Series 1 and Series 2 XBees, but has the disadvantage that the MY addresses may change upon power-cycling the XBees. The previous method uses the unique serial numbers from the XBees (SH/SL), so it is not affected. 

Shameless plug: Should you wish to make use of other advanced features from the XBees, like broadcasting or using more than two XBees, you will need to use API mode instead of AT. I had to fight a bit with it, so I collected the tools, articles, and tips that I found useful: http://erion.elmasllari.com/2012/06/in-the-trenches-with-xbee-resources-and-tips/