Infinite loop

Infinite loop python script + bug fixes in regular xml generator