// retoor <retoor@molodetz.nl>
import "html" for Document
var doc = Document.parse("<div id='container'><p>One</p><span>Two</span><a>Three</a></div>")
var container = doc.getElementById("container")
System.print(container.children.count) // expect: 3
var span = doc.querySelector("span")
container.removeChild(span)
System.print(container.children.count) // expect: 2
System.print(container.firstChild.tagName) // expect: P
System.print(container.lastChild.tagName) // expect: A
var p = doc.querySelector("p")
container.removeChild(p)
System.print(container.children.count) // expect: 1
System.print(container.firstChild.tagName) // expect: A