Knowing when to overwrite or append to the XML is a fundamental problem with our approach. In the beginning of the project we though to append alway, but we quickly learned that it takes a lot more work to intelligently append. We then took the approach to append when possible and easy, otherwise just overwrite. Since then I've found myself just building up jobs from scratch and not worrying about existing values in templates, essentially taking a "we leave you alone if you leave us alone" approach.
I'd be interested in hearing from the community how often templates are used (aka using() syntax) and if the manipulations are additive (adding to exist structures) or constructive (creating new structures).
I should also note that we're pretty bad about multiple calls being made, and we could be better. Calling environmentVariables multiple times would leave the last one as the winner. When we could defer its creation, accumulating the vars as we went. Once again, that takes more work and its something we can add later if needed. We should also document this better. So, if people see one behavior or other, please add it to the docs or bring it to our attention.