Added output for XML, added some extra asserts