XMega Software Interrupt?
The best way I have found to cause a software interrupt (without using an RTOS)  is to use one of the pinchange interrupts.  Activate the pullup resistor on the pin.  Then when you change the value, it will trigger the interrupt.