<html>
<head>
<script src="/demo/loadxmldoc.js">
</script>
</head>
<body>
<script>
xmlDoc=loadXMLDoc("books.xml");
len=xmlDoc.getElementsByTagName('book').length;
y=xmlDoc.getElementsByTagName("book")[len-1];
x=xmlDoc.documentElement.removeChild(y);
document.write("Removed node: " + x.nodeName);
</script>
</body>
</html>