Something like this should work ...
Code:
awk 'BEGIN{RS="$%^"}{for(i=1;i<=NF;i++){if($i ~ /<FileDetails>/){count++}}}END{print count}' file
Note that I've set the record-separator to a sequence of characters
not contained in my test-file.
Another approach:
Code:
grep -o '<FileDetails>' file |wc -l
Cheers,
Tink