I\'m trying to use XmlFile extension to delete entries in a XML file, this one to be precise: < Element name=\"Somename\" attribute2=\"whatever\" provider-name=\"whatever
To delete XML Elements you need to make use of the XMLConfig Element
The XMLFIile Element is used to update/delete attributes within an element:
deleteValue - Deletes a value from the element specified in the ElementPath. If Name is specified, the attribute with that name is deleted. If Name is not specified, the text value of the element specified in the ElementPath is deleted. The Value attribute is ignored if deleteValue is the action specified.
Since you have not mentioned the "Name" attribute it is trying to delete the text value. You dont have a text value in the ELEMENT and hence your file remains the same even after the edit.
UPDATE: Updated answer with the WIX script
<util:XmlConfig Id='SetXMlfiletest'
File='[#filename]'
Action='delete'
Node='element'
ElementPath="/Elements"
On='install'
PreserveModifiedDate='yes'
VerifyPath="/Elements/Element[\[]@name='Somename'[\]]"
Sequence="1" />
In the above script you need to update the "#filename" with the ID of your xml file.
Hope this helps!