```ruby
require 'oga'

module VSphereCloud
  module SdkHelpers
    class LogFilter

      FILTERS = [
        "soapenv:Envelope/soapenv:Body/Login/password",
      ]

      def filter(content)
        document = Oga.parse_xml(content)
        FILTERS.each do |filter|
          matching_node = document.xpath(filter)

          matching_node.each do |element|
            text = Oga::XML::Text.new
            text.text = 'redacted'

            element.children = [text]
          end
        end

        document.to_xml
      end

    end
  end
end
```

Use modified xml only if filter is applied
user
```ruby
require 'oga'

module VSphereCloud
  module SdkHelpers
    class LogFilter

      FILTERS = [
        "soapenv:Envelope/soapenv:Body/Login/password",
      ]

      def filter(content)
        modified = false

        document = Oga.parse_xml(content)
        FILTERS.each do |filter|
          matching_node = document.xpath(filter)

          matching_node.each do |element|
            modified = true
            text = Oga::XML::Text.new
            text.text = 'redacted'

            element.children = [text]
          end
        end

        if modified
          document.to_xml
        else
          content
        end
      end

    end
  end
end
```
assistant