Xmega Port Read/Write
I just assume at this point that you are using C. I suggest you read Atmels application notes AVR1000, AVR1313 and refer to the XMEGA datasheet of course. 

Port access for XMEGA is pretty easy compared to the regular ATMEGA types, since there are dedicated registers to set/clear/get/toggle IO pins. Furthermore there are predefined bit masks (suffix _bm), so you don't need to perform bit shifting in most cases.
Note that you still have to perform the initial port/pin configuration. 
Lets take port A pin 6 for a simple example.

PORTA.OUTSET = PIN6_bm;   // set to high
PORTA.OUTCLR = PIN6_bm;   // set to low
PORTA.OUTTGL = PIN6_bm;   // toggle state

// Get state of PA6 configured as OUTPUT as boolean:
bool pinState = (PORTA.OUT &amp; PIN6_bm) == 0 ? false : true;

// Get state of PA6 configured as INPUT as boolean:
bool pinState = (PORTA.IN &amp; PIN6_bm) == 0 ? false : true;


Maybe this helps getting started.