Java/XML: Counting elements based on parent element's attribute value...