fix racker#21

take xml tail into consideration when serializing xml