Added tests to output d and xml to make check how tree was being built.