Some improvements and backward compatibilities with old simplexml module