def xml_find(xpath):
 def xpath_find(value):
  validate(ET.iselement, value)
  value = value.find(xpath)
  if (value is None):
   raise ValueError("XPath '{0}' did not return an element".format(xpath))
  return validate(ET.iselement, value)
 return transform(xpath_find)

def xml_find ( xpath ) : def xpath_find ( value ) : validate ( ET . iselement , value ) value = value . find ( xpath ) if ( value is None ) : raise ValueError ( "XPath '{0}' did not return an element" . format ( xpath ) ) return validate ( ET . iselement , value ) return transform ( xpath_find )
find a xml element via xpath .