Generate XML Code