Fix to work with libxml2 2.9.0+ for old PHPs