Refactor and clean up AST2XML pass.
Merge branch 'cleaner-xml' into develop