Lazily pretty-print XML for logging
test scripts