I need to check whether a certain tag exists in an xml file.
For example, I want to see if the tag exists in this snippet:
hasattr() works for this:
hasattr()
if hasattr(root, 'elem1'): foo = root.elem1