Hi,
You reset sequence does not really comply with the handbook. Tx_digitalreset should always really be released first, followed by Rx_analogreset, followed by rx_digitalreset. this is all explained in the handbook and ensures a proper sequence for the Tx and Rx PLLs locking.
You do realise that there is already a loopback function in the ALT2GXB right? OK, so it looks like only the serial loopback is available in the XAUI mode but this could make it simpler for you (depending on what you are trying to do. all you need to do is pump in your data into the Tx_datain along with your tx_ctrlenable signals, then simply assert the rx_serialoopback and your transmitted serial data will be looped back to your Rx_datain. you should be able to observe the same data coming out of the Rx_dataout.
Hope this helps.