Fix to encode resources before parsing them into XML tree, because LXML ...

...works faster with encoded strings