Refactor: all: move internal XML functions to internal header
... and rename according to current style guidelines.
These were initially prefixed with a double underbar, so doxygen ignored them
even though they were in a public header. They were clearly intended to be
internal, so move them to an internal header.