backport to old libxml version