How do I make "bash -x" (debug mode) recurse into sourced scripts?

set -x somewhere in the root file (the one requiring all other files) should work. Alternatively, introduce something like [[ !-z "$DEBUG" ]] && set -x in each file, and call with DEBUG=1 script.sh.