generate code by xml