Add writeTree method to GTIndex