Use a glob pattern with -name option of find to indicate the desired pattern, *.txt in your case:
find . -type f -name '*.txt' -exec mv -t /destination {} +
Of course, replace /destination with the actual destination directory.
Notes:
You don't need to spawn xargs and an anonymous pipe, use the mv logic within the -exec predicate of find
find ... -exec handles all kind of possible filenames and ARG_MAX as well
GNU mv (default in Ubuntu) has -t to take a destination directory, so that you can leverage the + argument of -exec to send all files in single run of mv (or at least minimal runs if ARG_MAX is triggered in the process)