// makes extracting attribute values easier define xml_attrmap(in::xml_namedNodeMap_attr) => { local(out = map) with attr in #in do #out->insert(#attr->name = #attr->value) return #out } local( text = ' ', xml = xml(#text) ) local( students = #xml -> extract('//Student'), names = array ) with student in #students do { #names -> insert(xml_attrmap(#student -> attributes) -> find('Name')) } #names -> join('
')