<commit_before>module Xml
  
  class Xpath
        
    def initialize()
    end
    
    def evaluate(xml, xpath)
      Nokogiri::XML.parse(xml).xpath(xpath).to_xml
    end
    
  end

end<commit_msg>Xpath result type fix<commit_after>module Xml
  
  class Xpath
        
    def initialize()
    end
    
    def evaluate(xml, xpath)
      evaluated = Nokogiri::XML.parse(xml).xpath(xpath)
      
      result = if evaluated.is_a?(Nokogiri::XML::NodeSet)
        evaluated.to_xml
      else
        evaluated.to_s
      end
      return result
    end
    
  end

end
{'fraction_non_alphanumeric': 0.07908611599297012, 'fraction_numerical': 0.0, 'mean_word_length': 1.9230769230769231, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6308072', 'n_tokens_mistral': 197, 'n_tokens_neox': 198, 'n_words': 40}