analyze_xml now uses depth to decide to print tag_counts