def match(conditions)
      case conditions
        when String
          @content.index(conditions)
        when Regexp
          @content =~ conditions
        when Hash
          conditions = validate_conditions(conditions)

          # Text nodes only have :content, :parent, :ancestor
          unless (conditions.keys - [:content, :parent, :ancestor]).empty?
            return false
          end

          match(conditions[:content])
        else
          nil
      end
    end
def match(conditions)
      case conditions
        when String
          @content.index(conditions)
        when Regexp
          @content =~ conditions
        when Hash
          conditions = validate_conditions(conditions)

          # Text nodes only have :content, :parent, :ancestor
          unless (conditions.keys - [:content, :parent, :ancestor]).empty?
            return false
          end

          match(conditions[:content])
        else
          nil
      end
    end
Returns non-+nil+ if this node meets the given conditions, or +nil+
 otherwise. See the discussion of #find for the valid conditions.