I want to perform a basic if statement where if the xml tag
b:HotelId
if (xml.'**'.any { it.name() != 'b:HotelId' })
{
log.info true
}
else
{
log.info false
}
Here you go, follow in line comments.
//Find if there is such element, HotelId, in the xml
def hotelId = xml.'**'.find{ it.name() == 'HotelId' }
//The size should be at least 1, so you want to print false
if (hotelId.size()) {
log.info 'element found'
log.info false
} else {
//you want to print true
log.info 'element not found'
log.info true
}