Refactor generating XML
Refactor generating XML complex types