Convert xmlify to python3 version