<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<mask id="mymask">
<rect x="0" y="0" width="100px" height="100px" fill='white'/>
</mask>
</defs>
<rect fill="blue" height="100px" width="100px"/>
<g mask="url(#mymask)" visibility='hidden'>
<g visibility='visible'>
<rect x="0" y="0" width="200px" height="200px" fill="red"/>
<rect visibility="visible" x="0" y="0" width="100px" height="100px" fill="green"/>
</g>
<rect x="0" y="0" width="100px" height="100px" fill="red"/>
</g>
</svg>