Grab children, append after last child.
xml.children()[-1] + {
'security-constraint'({
'web-resource-collection'({
'web-resource-name'('Java Melody Monitoring')
'url-pattern'('/monitoring')
})
'auth-constraint'({
'role-name'('melody')
})
})
'login-config'({
'auth-method'('BASIC')
'realm-name'('Restricted Area')
})
}