The attached code triggers a class cast exception because in the groovy.util.Node plus operator, lines 179-180
it is assumed that all children are nodes, but the parser does not seem to create textnodes but keeping them as string, either that or some strange conversion is happening because in 179 a class cast exception is raised for a java.lang.String to groovy.util.Node illegal conversion.
The proof of concept is the attached junit code. If the commented line is uncommented, the cast exception appears. If the text in the xml is removed, the failure does not show.
XMLParser is being used.