def getSliceElements(xmlElement):
 gElements = xmlElement.getChildrenWithClassNameRecursively('g')
 sliceElements = []
 for gElement in gElements:
  if ('id' in gElement.attributeDictionary):
   idValue = gElement.attributeDictionary['id'].strip()
   if idValue.startswith('z:'):
    sliceElements.append(gElement)
 return sliceElements

def getSliceElements ( xmlElement ) : gElements = xmlElement . getChildrenWithClassNameRecursively ( 'g' ) sliceElements = [ ] for gElement in gElements : if ( 'id' in gElement . attributeDictionary ) : idValue = gElement . attributeDictionary [ 'id' ] . strip ( ) if idValue . startswith ( 'z:' ) : sliceElements . append ( gElement ) return sliceElements
get the slice elements .