def rule_hits(results_doc, instance_doc, rule_type, xpath)
      
      results = []
      
      results_doc.root.find(xpath, NS_PREFIXES).each do |hit|
        context = instance_doc.root.find_first hit['location']
        
        hit.find('svrl:text/text()', NS_PREFIXES).each do |message|
          results << {
            :rule_type => rule_type,
            :type => context.node_type_name,
            :name => context.name,
            :line => context.line_num,
            :message => message.content.strip }
        end
      end
      
      results
      
    end
def rule_hits(results_doc, instance_doc, rule_type, xpath)
      
      results = []
      
      results_doc.root.find(xpath, NS_PREFIXES).each do |hit|
        context = instance_doc.root.find_first hit['location']
        
        hit.find('svrl:text/text()', NS_PREFIXES).each do |message|
          results << {
            :rule_type => rule_type,
            :type => context.node_type_name,
            :name => context.name,
            :line => context.line_num,
            :message => message.content.strip }
        end
      end
      
      results
      
    end
Look for reported or failed rules of a particular type in the instance doc