class Nokogiri::XML::NodeSet

def delete(node) # :nodoc:

:nodoc:
def delete(node) # :nodoc:
  raise(ArgumentError, "node must be a Nokogiri::XML::Node") unless node.is_a?(XML::Node)
  if LibXML.xmlXPathNodeSetContains(cstruct, node.cstruct) != 0
    LibXML.xmlXPathNodeSetDel(cstruct, node.cstruct)
    return node
  end
  return nil
end