Every SVG object has an 'id'

The object id is the SVG element 'id' or if it does not exists the Python
object id().
Add JSONEncoder class: export SVG group tree to JSON

This is mostly for debugging purposes