A topological characterization of -trees