# File lib/rbrainz/webservice/mbxml.rb, line 62 def get_entity(entity_type) # Search for the first occuring node of type entity which is a child node # of the metadata element. entity = @document.elements["//[local-name()='metadata' and namespace-uri()='%s']/%s[1]" % [Model::NS_MMD_1, Utils.entity_type_to_string(entity_type)]] unless entity.nil? or entity.is_a? REXML::Text create_method = method('create_' + entity_type.to_s) create_method.call(entity) if create_method else return nil end end