Bottom Line: It is 100% safe to delete DocSets. Xcode downloads offline API reference documentation packages for iOS, macOS, watchOS, and tvOS development.
What is Xcode DocSets?
Located at ~/Library/Developer/Shared/Documentation/DocSets or ~/Library/Caches/com.apple.dt.Xcode, offline documentation bundles accumulate multi-gigabyte files over time.
How to Delete Xcode Documentation Sets
rm -rf ~/Library/Developer/Shared/Documentation/DocSets/*
Discussion
Loading authentication...