Recursively unwrap tree structure