Your strategy sounds good, but perhaps I can simplify your implementation. (tough for me to tell since you didn't show how you are currently doing it).
You could simply process the results of a recursive FINDSTR search with a FOR /F loop.
for /f "eol=: delims=" %%F in (
'findstr /mls "<packaging>pom</packaging>" "yourRootPath\pom.xml"'
) do echo %%~dpF