convenience method to get the graph from XdiContext
re-organizing inner root handling