I am trying to add an id to the first tag that contains the entire tree by adding the following code
var gElement = document.createElement(\'g\'); g