XML_Statistics is a package that allows you to analyze XML documents, which can be files or strings.
XML_Statistics is able to count tags, attributes, processing instructions, external entities and cdata blocks. Furthermore you can apply filters so you are able to count only the tags in a specific depth or only the attributes of a specific tag.