Code that shows a list of my friends, and clicking that friend, show the friends he has ...

Hello people, 

I need to make an implementation on elgg and am having trouble because I did not find anything related to it. 

Just need a code that shows a list of my friends, and clicking that friend, show the friends he has, I need something simple to just show it. 

If someone has something or can help me I thank you, 
Thank you !...