def ptrlreptodict(xmlfile):

	PATROLREPORT_NS = '{http://helyx.co.uk/infopath/2003/myXSD/2010-06-09}'

	tree = ElementTree.parse(xmlfile)

	d = {}
	''' get each of the grouped nodes '''
	report = tree.find(PATROLREPORT_NS + 'Report')
	patrol = tree.find(PATROLREPORT_NS + 'Patrol')
	task = tree.find(PATROLREPORT_NS + 'Task')
	observations = tree.find(PATROLREPORT_NS + 'Observations')
	patrolcondition = tree.find(PATROLREPORT_NS + 'PatrolCondition')
	''' get report nodes '''
	reportnumber = report.find(PATROLREPORT_NS + 'ReportNumber').text
	classification = report.find(PATROLREPORT_NS + 'Classification').text
	_to = report.find(PATROLREPORT_NS + 'To').text
	_from = report.find(PATROLREPORT_NS + 'From').text
	reportdatetime = report.find(PATROLREPORT_NS + 'ReportDateTime').text
	''' get patrol nodes '''
	callsign = patrol.find(PATROLREPORT_NS + 'Callsign').text
	subunit = patrol.find(PATROLREPORT_NS + 'Subunit').text
	patrolbase = patrol.find(PATROLREPORT_NS + 'PatrolBase').text
	patroltype = patrol.find(PATROLREPORT_NS + 'PatrolType').text
	patrolcommand = patrol.find(PATROLREPORT_NS + 'PatrolCommand').text
	interpreter = patrol.find(PATROLREPORT_NS + 'Interpreter').text
	patrolsize = patrol.find(PATROLREPORT_NS + 'PatrolSize').text
	composition = patrol.find(PATROLREPORT_NS + 'Composition').text
	''' get task nodes '''
	opname = task.find(PATROLREPORT_NS + 'OpName').text
	taskname = task.find(PATROLREPORT_NS + 'TaskName').text
	taskdescription = task.find(PATROLREPORT_NS + 'TaskDescription').text
	''' get observation nodes '''
	terraindescription = observations.find(PATROLREPORT_NS + 'TerrainDescription').text
	miscinfo = observations.find(PATROLREPORT_NS + 'MiscInfo').text
	conclusions = observations.find(PATROLREPORT_NS + 'Conclusions').text
	''' ignore the EnemySightings nodes which go in another table '''
	''' get patrolcondition nodes '''
	numpatrolok = patrolcondition.find(PATROLREPORT_NS + 'NumPatrolOK').text
	numpatrolwounded = patrolcondition.find(PATROLREPORT_NS + 'NumPatrolWounded').text
	numpatrolkia = patrolcondition.find(PATROLREPORT_NS + 'NumPatrolKIA').text
	numpatrolmissing = patrolcondition.find(PATROLREPORT_NS + 'NumPatrolMissing').text
	numpatrolcaptured = patrolcondition.find(PATROLREPORT_NS + 'NumPatrolCaptured').text

	yield reportnumber, classification, _to, _from, reportdatetime, \
		  callsign, subunit, patrolbase, patroltype, patrolcommand, \
		  interpreter, patrolsize, composition, opname, taskname, \
		  taskdescription, terraindescription, miscinfo, conclusions, \
		  numpatrolok, numpatrolwounded, numpatrolkia, numpatrolmissing, \
		  numpatrolcaptured
Parses the xml to extract the PatrolReport fields into a dictionary
dataset/ETHPy150Open Esri/solutions-geoprocessing-toolbox/data_management/toolboxes/scripts/ImportPatrolRptXML.py/ptrlreptodict