from gnosis.xml.objectify import make_instance from gnosis.xml.objectify.utils import * import sys xml = ''' this that other ''' o = make_instance(xml) for node in XPATH(o,'bar'): print node