def highwiredict2xmlstring(highwire_elements, ordering=HIGHWIRE_ORDER):
    """Create an XML string from the highwire data dictionary."""
    # Sort the elements by the ordering list.
    highwire_elements.sort(key=lambda obj: ordering.index(obj.name))
    root = Element('metadata')
    for element in highwire_elements:
        attribs = {'name': element.name, 'content': element.content}
        SubElement(root, 'meta', attribs)
    # Create the XML tree.
    return '<?xml version="1.0" encoding="UTF-8"?>\n' + tostring(
        root,
        pretty_print=True
    )
Create an XML string from the highwire data dictionary.