The hierarchy is created each time you define a JMS templates and that you use it into a slave site.
So the relationhip is slave site where is retreive the JMS template ID.
Once the JMS template ID is found, it retreive the website that is defined in the JMS templates and so on.
I told you that reterive the hierarchy level is not easy.
If you want that we develop specific thing for you, this is possible with our billable support that you can order at
www.jms2win.com/download?page=shop.produ...35&category_id=1