def is_pointer_tag(xml_obj):
 if (xml_obj.tag != 'course'):
  expected_attr = set(['url_name'])
 else:
  expected_attr = set(['url_name', 'course', 'org'])
 actual_attr = set(xml_obj.attrib.keys())
 has_text = ((xml_obj.text is not None) and (len(xml_obj.text.strip()) > 0))
 return ((len(xml_obj) == 0) and (actual_attr == expected_attr) and (not has_text))

def is_pointer_tag ( xml_obj ) : if ( xml_obj . tag != 'course' ) : expected_attr = set ( [ 'url_name' ] ) else : expected_attr = set ( [ 'url_name' , 'course' , 'org' ] ) actual_attr = set ( xml_obj . attrib . keys ( ) ) has_text = ( ( xml_obj . text is not None ) and ( len ( xml_obj . text . strip ( ) ) > 0 ) ) return ( ( len ( xml_obj ) == 0 ) and ( actual_attr == expected_attr ) and ( not has_text ) )
check if xml_obj is a pointer tag: <blah url_name="something" /> .