Layering SVGs in JavaScript

var inside1 = document.getElementById('inside1')
document.getElementById('svg').appendChild(inside1);
appendChild removes the element from the input element’s parent, hence why it’s the first childNodes added to the mainSVG, and why I keep appending until there are no more childNodes in the svgDOM.