def METHOD_NAME(self, data, el_type, tags, max_elements, detailed_elements):
    root = ElementTree.fromstring(data)
    # if list provided in config, only send those metrics
    if detailed_elements:
        elements = [e for e in root.findall(el_type) if e.get('name') in detailed_elements]
    else:
        elements = [e for e in root.findall(el_type) if e.get('name')]
    count = len(elements)
    if count > max_elements:
        if not detailed_elements:
            self.warning(
                "Number of %s is too high (%s > %s). "
                "Please use the detailed_%ss parameter"
                " to list the %s you want to monitor.",
                el_type,
                count,
                max_elements,
                el_type,
                el_type,
            )
    for el in elements[:max_elements]:
        name = el.get("name")
        stats = el.find("stats")
        if stats is None:
            continue
        el_tags = tags + ["{0}:{1}".format(el_type, name)]
        for attr_name, alias in iteritems(TOPIC_QUEUE_METRICS):
            metric_name = "activemq.{0}.{1}".format(el_type, alias)
            value = stats.get(attr_name, 0)
            self.gauge(metric_name, value, tags=el_tags)
    self.log.debug("ActiveMQ %s count: %s", el_type, count)
    self.gauge("activemq.{0}.count".format(el_type), count, tags=tags)