Helper function for XML formatting.