added test for XML serialized and fixed a bug in it. issue #40