code: def _set_packages(self, node):
          '''
          Set packages and collections.
  
          :param node:
          :return:
          '''
          pkgs = etree.SubElement(node, 'packages')
          for pkg_name, pkg_version in sorted(self._data.software.get('packages', {}).items()):
              pkg = etree.SubElement(pkgs, 'package')
              pkg.set('name', pkg_name)
  
          # Add collections (SUSE)
          if self.__grains__.get('os_family', '') == 'Suse':
              for ptn_id, ptn_data in self._data.software.get('patterns', {}).items():
                  if ptn_data.get('installed'):
                      ptn = etree.SubElement(pkgs, 'namedCollection')
                      ptn.set('name', ptn_id)
  
          return pkgf _set_packages(self, node):
          '''
          Set packages and collections.
  
          :param node:
          :return:
          '''
          pkgs = etree.SubElement(node, 'packages')
          for pkg_name, pkg_version in sorted(self._data.software.get('packages', {}).items()):
              pkg = etree.SubElement(pkgs, 'package')
              pkg.set('name', pkg_name)
  
          # Add collections (SUSE)
          if self.__grains__.get('os_family', '') == 'Suse':
              for ptn_id, ptn_data in self._data.software.get('patterns', {}).items():
                  if ptn_data.get('installed'):
                      ptn = etree.SubElement(pkgs, 'namedCollection')
                      ptn.set('name', ptn_id)
  
          return pkgs
docs: Set packages and collections.
  
          :param node:
          :return: