Atmel Xmega PWM problem
Here's the code which solved my problem of PWM. Its a standalone code for PWM generation for ATXmega256A3BU. It uses timer-0 for PWM generation on PC.0 pin.

#include "ioxm256a3bu.h"
#include &lt;stdint.h&gt;
#include &lt;stdio.h&gt;

void pwm_init(void);

int main( void )
{
 pwm_init();
 TCC0_CCABUF = 0x7FFF;                      //set the duty cycle as 50%
 while((TCC0_INTFLAGS &amp; 0x01) == 0);     //wait for the new compare value to be loaded 
 TCC0_INTFLAGS = 0x00;                   //clear the interrupt flag
 while(1);
}

 void pwm_init()
{
 PORTC_DIR = 0x01;             //Set PC.0 as the output port 
 TCC0_PER = 0xFFFF;            //Set the period of the waveform 
 TCC0_CTRLB |= 0x03;           //Single slope mode     
 TCC0_CTRLB |= 0x10;           //channel selection CCAEN
 TCC0_CTRLA |= 0x02;           //clock selection clk/2
}