def processElementNodeByFunctionPair(elementNode, geometryFunction, pathFunction):
 elementAttributesCopy = elementNode.attributes.copy()
 targets = evaluate.getElementNodesByKey(elementNode, 'target')
 for target in targets:
  targetAttributesCopy = target.attributes.copy()
  target.attributes = elementAttributesCopy
  processTargetByFunctionPair(geometryFunction, pathFunction, target)
  target.attributes = targetAttributesCopy

def processElementNodeByFunctionPair ( elementNode , geometryFunction , pathFunction ) : elementAttributesCopy = elementNode . attributes . copy ( ) targets = evaluate . getElementNodesByKey ( elementNode , 'target' ) for target in targets : targetAttributesCopy = target . attributes . copy ( ) target . attributes = elementAttributesCopy processTargetByFunctionPair ( geometryFunction , pathFunction , target ) target . attributes = targetAttributesCopy
process the xml element by the appropriate manipulationfunction .