we can indeed just return a DocumentFragment.

instead of returning true or false, we can either return a DocumentFragment or null.
Then the caller can append the DocumentFragment wherever he wants.