Okay, thanks to the answer in this post I figured it out.
Here is how it looks like:
{% assign tax9 = 0 %}
{% for line_item in line_items %}
{% for tax_line in line_item.tax_lines %}
{% if tax_line.rate == 0.09 %}
{% capture taxline9 %}
{{ tax_line.price | times: line_item.quantity }}
{% endcapture %}
{% assign tax9 = tax9 | plus: taxline9 %}
{% endif %}
{% endfor %}
{% endfor %}
{{ tax9 | money }}