Build: Break a large chunk of xml Makefile out into a script.
This makes it a little easier to follow due to less escaping and fewer dollar signs and line continuations.