Fix: xml: Fix segfault in find_entity()
(cherry picked from commit dd105a6fd1cbf9a0647a44896c3a2c2d1c0f127f)