title: Search and remove element with elementTree in Python
body: <p>I have an XML document in which I want to search for some elements and if they match some criteria
  I would like to delete them</p>
  
  <p>However, I cannot seem to be able to access the parent of the element so that I can delete it</p>
  
  <pre><code>file = open('test.xml', "r")
  elem = ElementTree.parse(file)
  
  namespace = "{http://somens}"
  
  props = elem.findall('.//{0}prop'.format(namespace))
  for prop in props:
      type = prop.attrib.get('type', None)
      if type == 'json':
          value = json.loads(prop.attrib['value'])
          if value['name'] == 'Page1.Button1':
              #here I need to access the parent of prop
              # in order to delete the prop
  </code></pre>
  
  <p>Is there a way I can do this?</p>
  
  <p>Thanks</p>