Add junit tests to test xml generation and parsing