def add_control_scanning_to_xml(xml, enabled)
      if elem = REXML::XPath.first(xml, '//enableControlsScan')
        elem.attributes['enabled'] = enabled ? '1' : '0'
      else
        elem = REXML::Element.new('ControlsScan', xml.root)
        elem.add_element('enableControlsScan',
                         'enabled' => enabled ? '1' : '0')
      end
    end
def add_control_scanning_to_xml(xml, enabled)
      if elem = REXML::XPath.first(xml, '//enableControlsScan')
        elem.attributes['enabled'] = enabled ? '1' : '0'
      else
        elem = REXML::Element.new('ControlsScan', xml.root)
        elem.add_element('enableControlsScan',
                         'enabled' => enabled ? '1' : '0')
      end
    end
Internal method for updating control scanning before saving.