title: Get g bounding box in svg units
body: <p>I am trying to implement a <em>menu</em> in <em>Javascript</em> with single <em>menu-items</em> being <code>svg:g</code>.
  To mark an item as selected I would like to move another <code>svg:g</code> on top of the <em>menu-item</em>.</p>
  
  <p>For this I need to get the bounding box of the <em>menu-item</em> (=<code>svg:g</code>) so I can apply the rect (x, y, width, height) to the other. I have not found a convenient way yet, for getting the bounding box of a <code>svg:g</code>.</p>
  
  <p>The only way I can think of would be recursing into the children and calculating the bounding box (approximation) by hand. Is there a more elegant way? </p>