Connecting xbee with Beaglebone green

Hello

I want to use Pybbio library with xbee library to receive data through UART pins.

Is there any one who can help me for this.

I tried something like

from bbio import *
from xbee import XBee

def setup():
Serial2.begin(9600)

def loop():
if Serial2.available():

xbee= XBee(Serial2.read())

z= xbee.wait_read_frame()
print z
run(setup, loop)