代码示例:(标识:xdom_removecurrent)
<html>
<head>
<script type="text/javascript" src="/static/demo/html/js/loadxmldoc.js"> 
</script>
</head>
<body>
<script type="text/javascript">
xmlDoc=loadXMLDoc("/static/demo/xdom/books.xml");

document.write("removeChild() 方法执行前 book 节点的数目:");
document.write(xmlDoc.getElementsByTagName("book").length);
document.write("<br />");

x=xmlDoc.getElementsByTagName("book")[0]
x.parentNode.removeChild(x);

document.write("removeChild() 方法执行后 book 节点的数目:");
document.write(xmlDoc.getElementsByTagName("book").length);

</script>
</body>
</html>
运行结果: