WrapAtEol isn't a necessity, it is just there becuase some of the lines were wrapping. You'll notice that it doesn't have the regular UDF header, as it isn't finalized yet.

I'd like more comments regarding whether to return the XML as a string vs. an object. This could be the first of a mess of XML library functions.