this is my favorite hack (not sure it should work). It refer an element that is not yet displayed, and it works pretty well
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 620 40" preserveAspectRatio="xMidYMid meet">_x000D_
<defs>_x000D_
<filter x="-0.02" y="0" width="1.04" height="1.1" id="removebackground">_x000D_
<feFlood flood-color="#00ffff"/>_x000D_
</filter>_x000D_
</defs>_x000D_
_x000D_
<!--Draw the text--> _x000D_
<use xlink:href="#mygroup" filter="url(#removebackground)" />_x000D_
<g id="mygroup">_x000D_
<text id="text1" x="9" y="20" style="text-anchor:start;font-size:14px;">custom text with background</text> _x000D_
<line x1="200" y1="18" x2="200" y2="36" stroke="#000" stroke-width="5"/> _x000D_
<line x1="120" y1="27" x2="203" y2="27" stroke="#000" stroke-width="5"/> _x000D_
</g>_x000D_
</svg>
_x000D_