Would it somehow be possible for tag to be an object too...?

Maybe the best thing to do here is just call .toString() on both `tag` and `content`? Then it's guaranteed to be a string, right?