Code generator from xapi