code: def get_optional_attribute(self, element, attribute):
      
      try:
        return self.get_attribute(element, attribute)
      except self.XmlError:
        return None
docs: Attempt to retrieve an optional attribute from the xml and return None on failure.