def get_elements(tree, tag_name):
    """
    returns a list of all elements of an XML tree that have a certain tag name,
    e.g. layers, edges etc.

    Parameters
    ----------
    tree : lxml.etree._ElementTree
        an ElementTree that represents a complete SaltXML document
    tag_name : str
        the name of an XML tag, e.g. 'nodes', 'edges', 'labels'
    """
    return tree.findall("//{0}".format(tag_name))