Correctly parsing xml to load pattern processes of a loop