Forum Discussion

praneeth12's avatar
praneeth12
Occasional Contributor
5 years ago

Add/remove elements from xml-request

How to  remove single element from xml.Below is the code for specific element but i am not able to delete selected element from the xml and serialize xml.

 

def slurped = new XmlSlurper().parseText(requestXML1)

//grope of eliment size 4
def gropeOfEliments= slurped.'**'.findAll{

it.name() == 'licenseStatus' 

}

//how to delete 3rd element and serialize with 3 eliments.