I got 2 scripts one in perl second in python. Bysically the both do the same. But the differ in results. I need the one in perl to be rewriten to python, and leave rules that are used in original python scripts in comments so that I can add them to process or remove. Scripts extrat data from XML-file. Sample XML file and script in project attachment.