Also, is this returning all nested types, at any nesting level? (The call to ``elem.getTypes`` looks like could be doing that). In that case, maybe ``allNestedTypes`` may be a better name.