Recursive retrieval

Adds the capability to retrieve resources recursively.