Hot fix for the billion laughs XML vulnerability

This replaces the original fix for a fix proposed by @hjblok