Add an XML writer, plus some guff to make it work

...like index() to check if a key is in an array.
The writer isn't pretty; I need to figure out how newlines should be handled.