<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def find_next_link(root, current_joint, next_link_name):
 """ Find the next link in the URDF tree Parameters root current_joint: xml.etree.ElementTree The current URDF joint next_link_name: str Optional : The name of the next link. If not provided, find it automatically as the first child of the joint. """

    has_next = False
    next_link = None

    # If no next link, find it automatically
    if next_link_name is None:
        # If the name of the next link is not provided, find it
        next_link_name = current_joint.find("child").attrib["link"]

    for urdf_link in root.iter("link"):
        if urdf_link.attrib["name"] == next_link_name:
            next_link = urdf_link
            has_next = True
    return has_next, next_link