Cleanup of xml and logging.