org.w3c.dom.Node 中有一个方法 removeChild(Node oldChild) public Node removeChild(Node oldChild)
                 throws DOMExceptionRemoves the child node indicated by oldChild from the list of children, and returns it. Parameters:
oldChild - The node being removed. 
Returns:
The node removed. 
Throws: 
DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 
NOT_FOUND_ERR: Raised if oldChild is not a child of this node.

解决方案 »

  1.   

    楼主这样的问题很奇怪哦
    jdom的Element类有很多remove方法的
    如果在使用这些remove方法的时候有什么困难的话
    请把问题说得更具体些
    不然让人都不知道该如何回答
      

  2.   

    Xpath belongs in DOM of W3C, if you got the Node using Xpath, I feel you can use node.getParent().removeNode... directly (it's a operation of DOM).
      

  3.   

    Node node=XPath.selectSingleNode(...node.getParent().removeNode...(node)..that's ok.