Convert Python Dictionary or List of Dictionaries to XML string Python Code snippet to convert a dictionary or a list of dictionaries into a valid XML string.