Below XPath might come in handy when you want to remove some unwanted values from you entire XML document.

 

//*[text()='(NULL)’]

 

“//*” statement selects all nodes from XML Document

“[text()='(NULL)’]” statement checks the node selected by above statement for text “(NULL)” if nodes text is equal to this criteria it is returned

 

You can add your namespace as well to the statement.

//*[text()='(NULL)’ and namespace-uri()=’http://soap.microsoft.com/schemas/%5D

Also, you could join search statements as well to filter multiple values

//*[text()='(NULL)’ or text()=’false’ or text()=’CA’]

Advertisements