The Wire Facebook Like Hierarchy - Tree Structure

By default the wire thread shows a hierarchy when it comes to replies but only when you click previous. I want to change the hierarchy by showing the parent post on top and its replies underneath in a tree like form. There is a parent relationship found in elgg_entity_relationships where I am trying to build this tree. 

wire post one
-first reply to wire post one
--reply to first reply to wire post one
-second reply to wire post one

I know in oracle databases there is a function named "connect by prior" so this hierarchy structure can be accomplished. 

Any suggestions? Thank you for taking your time to read my question. 

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking