(key, val)
return element
Gets an element from a key/value pair assumed to be pulled from
    a case object (usually in the dynamic properties)
Gets an element from a key/value pair assumed to be pulled from
    a case object (usually in the dynamic properties)
Gets an element from a key / value pair assumed to be pulled from a case object ( usually in the dynamic properties )
def get_dynamic_element(key, val):
    """
    Gets an element from a key/value pair assumed to be pulled from
    a case object (usually in the dynamic properties)
    """
    element = ElementTree.Element(key)
    if isinstance(val, dict):
        element.text = str(val.get('#text', ''))
        element.attrib.update({
            k[1:]: str(v) for k, v in val.items() if k and k.startswith("@")})
    else:
        # assume it's a string. Hopefully this is valid
        element.text = str(val)
    return element
def get_dynamic_element ( key , val ) : element = ElementTree . Element ( key ) if isinstance ( val , dict ) : element . text = str ( val . get ( '#text' , '' ) ) element . attrib . update ( { k [ 1 : ] : str ( v ) for k , v in val . items ( ) if k and k . startswith ( "@" ) } ) else : # assume it's a string. Hopefully this is valid element . text = str ( val ) return element