Deduplicated code related to finding ColumnGroup and Document entries.