Why don't use the "SRC_TOP technique" used by @kzangeli in the xmlChecker.sh script?