def find_ns_subelements(element, subelement_name, ns_dict):
        """
        retuns list of subelements with given name in any given namespace

        Arguments:
        - element (ElementTee.Element): main element to search in
        - subelement_name (string): searched name of element
        - ns_dict: dict of prefixes and corresponding full namespaces

        Hint:
        To search for parent element, add "/.." in the end.
        Example:
        fund_ns_subelements(root, "my_element/../..", ns_dict)
        will return list of grandparents of elements "my_element"
        """

        subelements = []

        # Search term explanation:
        # .//* read from right to left means:
        # all elements (*) in any level (//) in top-level element (.)
        # If you want to search nodes with some attribute:
        # .//*[@attr='something'] means:
        # nodes with attribute attr='something' located anywhere (.//*)
        # Our case: elements with namespace (in {}) and name, anywhere:
        # .//{namespace}name

        # We are looking for given element in any namespace.
        # In newer Python versions you can use *
        # and the solution would be one-liner:
        # return element.findall(f".//{{*}}{subelement_name}")
        # Below code should be compatible with older versions

        for prefix in ns_dict:
                ns = ns_dict[prefix]
                match = f".//{{{ns}}}{subelement_name}"
                found = element.findall(match)
                for subelement in found:
                        subelements.append(subelement)
        return subelements