Here is a faster-than-grep AWK alternative way of doing this, which handles multiple matches of
per line, within a collection of XML files in a directory:
awk '//{m=gsub("","");total+=m}END{print total}' some_directory/*.xml
This works well in cases where some XML files don't have line breaks.