This script will return how many time one string occurs within another. It will only work on SQL 2K as it is a UDF, but it could be converted to a stored proc with a output variable for SQL 7.0.
Methods for Parsing XML files
Jon shows you several ways you can parse XML.
2007-10-02 (first published: 2002-06-20)