public void BeginEntity (object entity) { if (inGroup) { WriteLine ("</g>"); } var id = (entity != null) ? entity.ToString () : ""; WriteLine ("<g id=\"{0}\">", id); inGroup = true; }