workaround for lxml < 3.1.2