Can I do this with a custom tag?
Absolutely.
You didn't mention how the address data is making its way to the page, so I will assume you are using a modern Model 2 design.
Let's say that your
servlet controller is placing an object of type Address that holds your address data onto the request as a scoped variable named "billingAddress", and another named "shippingAddress".
You could write a custom tag along the lines of:
which will spit out the approriate HTML-formatted data according to what it finds in the scoped variable identified by the "data" attribute.