Switch minidom to ElementTree to actually properly support nested categories.