If it's ok to overwrite the list of positional parameters:
shopt -s globstar nullglob
set -- foo/**/bar.xml foo/**/baz.xml
if [ "$#" -ne 0 ]; then
echo matches found
fi
This sets the list of positional parameters to the names matching the globbing pattern. Since nullglob is in effect, the list will be empty if no matches are found. The value of $# is the length of the list of positional parameters.
Using your idea of running it in a subshell:
( shopt -s globstar nullglob; set -- foo/**/bar.xml foo/**/baz.xml; [ "$#" -ne 0 ] )
Using an array in place of the list of positional parameters:
shopt -s globstar nullglob
names=( foo/**/bar.xml foo/**/baz.xml )
if [ "${#names[@]}" -ne 0 ]; then
echo matches found
fi