implemented XML formatter and added unit tests