def get_first_element_index(root, tag_name):
tag_index = <NUM_LIT:1><EOL>for tag in root:<EOL><INDENT>if tag.tag == tag_name:<EOL><INDENT>return tag_index<EOL><DEDENT>tag_index = tag_index + <NUM_LIT:1><EOL><DEDENT>return None<EOL>
In order to use Element.insert() in a convenient way,
this function will find the first child tag with tag_name
and return its index position
The index can then be used to insert an element before or after the
found tag using Element.insert()