1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <svg xmlns=
"http://www.w3.org/2000/svg">
3 <rect id=
"red" width=
"100" height=
"100" fill=
"red" />
4 <script type=
"text/javascript">
6 var red = document.getElementById('red');
7 var green = document.createElementNS(
"http://www.w3.org/2000/svg",
"rect");
8 green.setAttribute(
"width",
"100");
9 green.setAttribute(
"height",
"100");
10 green.setAttribute(
"fill",
"green");
11 red.ownerDocument.rootElement.appendChild(green);