def pyAttrName2XmlAttrName(key):
    """
    The @pyAttrName2XmlAttrName@ converts the Python XML attribute name @key@ to an
    appropriate XML attribute identifier.
    If the *key* is 'cssClass' then it is translated into 'class'.
    If an HTML5 attribute *data_xxxx* is used, then change that to *data-xxxx*.
    """
    if key == 'cssClass':
        key = 'class'
    elif key == 'cssId':
        key = 'id'
    elif key.startswith('data'):
        key = key.replace('_', '-')
    return key