def find_prefix(doc)
      return config['prefix'] if config && config['prefix']

      # Loop through the attributes until we see one with the same value
      ns_prefix_attribute = doc.namespaces.find do |prefix, ns|
        ns.to_s == namespace.to_s && prefix != 'xmlns'
      end

      # If the attribute was found, return it, otherwise return nil
      ns_prefix_attribute ? ns_prefix_attribute[0].split(':').last : "Unknown"
    end
def find_prefix(doc)
      return config['prefix'] if config && config['prefix']

      # Loop through the attributes until we see one with the same value
      ns_prefix_attribute = doc.namespaces.find do |prefix, ns|
        ns.to_s == namespace.to_s && prefix != 'xmlns'
      end

      # If the attribute was found, return it, otherwise return nil
      ns_prefix_attribute ? ns_prefix_attribute[0].split(':').last : "Unknown"
    end
Find the namespace prefix by searching through the namespaces for the TNS