# This works on the transformed version that has # the value form # rather than the generic # name12.... # for of a property/p list. # count = 0 songs = vector("list", 100) song = function(parser, node, ...) { count <<- count + 1 if(count == length(songs)) xmlStopParser(parser) songs[[count]] <<- node TRUE } class(song) = "XMLParserContextFunction" xmlEventParse("itunes.xml", branches = list(song = song))