add test and fixed bug for XML Reader