def _get_children_by_tag_name(node, name):
    """Retrieves all children from node 'node' with name 'name' and
    returns them as a list."""
    try:
        return [child for child in node.childNodes if child.nodeName == name]
    except TypeError:
        return []