NOTE: This patch might affect xml_cdr, so better check if the output is to your liking after this commit