XML builder refactor/meta-programming