<svg width="5cm" height="5cm" version="1.1">
     <desc>Two groups, each of two rectangles </desc>
     <g id="group1" fill="red">
          <rect x="1cm" y="1cm" width="1cm" height="1cm"/>
          <rect x="3cm" y="1cm" width="1cm" height="1cm"/>
     </g>
     <g id="group2" fill="blue">
          <rect x="1cm" y="3cm" width="1cm" height="1cm"/>
          <rect x="3cm" y="3cm" width="1cm" height="1cm"/>
     </g>
     <rect x=".01cm" y=".01cm" width="4.98cm" height="4.98cm" fill="none" stroke="blue" stroke-width=".02cm"/>
</svg>
Original SVG source