Yes, if I understand you correctly, you are looking for the "Content Placement Options"; you can check the box for "Remove blank lines for empty fields."
Does that exist for XML?
My eyes went directly to <address2> and I missed the (obvious) reference to tagged structure, thought it was a Data Merge.
Join the club.
I thought that might have been the case, which is why I asked, but I was hoping you were going to say "of course it is."
For XML to ignore empty fields, you'd have to use a custom XSLT stylesheet. It can be a pretty standard one, though. Google for "identity.xsl", which copies items verbatim; then add a single template to omit an empty tag, either a single one, or one from a list of candidates, or even any and all empty tags.
will this remove all unused tags in my whole file or just the ones I specify
Whatever you like. It depends on what you add to "this".
A work-around if you don't already use XSLT (to avoid having to) is to not have placeholder text, just use empty tags in your text layout that correspond to your incoming XML structure (any unused by the incoming structure IN ORDER, will be skipped). So long as you don't mind the blank line (rather than left over placeholder copy).
If you had placeholder copy in your text box (<address2> for example) look at it using the story editor window (edit > edit in story editor, or command-y/control-y) so you can see the surrounding tags... style the surrounding tags by selecting them with the cursor and applying character or paragraph styles (with text in between the tags at the time) and then delete only the placeholder text from the middle of the sandwich, leaving the tags in tact. Trying to do this without being in the story editor will not work.
Also, when importing the XML, I believe you'll still need to use "merge content" and "don't import empty white space" as you have been in order to replace placeholder text in any areas you had it.
For situations when you have a mixture of dynamic and static text in the same text block and you are merging data (more so when the placeholder text has been deleted as I've suggested above but the dynamic tags for the possible incoming text are still there), you can use a tag you've created (I call mine "staticText") in your layout to wrap ANY bits of text you don't want to accidentally delete when the surrounding tags get populated or not, using the merge option upon importing your XML. Just be sure never to use "staticText" as an actual tag in your structure or surrounding incoming data. The text contained within staticText tags in your layout will be ignored by incoming data, and won't accidentally get deleted when it's sandwiched between two sets of tags that are dynamically populated when merge content is the import option.
In my example below I'm using brackets/carats with the tag name instead of the color coded tag icon you see in the story editor, also I've used LB here to indicate a regular line break in Indesign and SP a regular space character in indesign:
all other tags on following lines...
This should just leave a blank line for address2 when no data comes in for it. I'm assuming you have line breaks, if not, all the better.