XML:delete([path])
Delete the current element and all child elements from the document. If the path is specified, the element identified by the path will be deleted. Returns true if an element was deleted or false otherwise. The current position is set to be the parent of the deleted node. The root element of the document cannot be deleted using the delete method.
Example
doc:goPath('/foo/bar[3]')
doc:delete()
if not doc:delete('/foo/bar') then
error('Failed to delete element /foo/bar!')
end