Extension:Tree to Query