helper function to process all ADMX files in the specified policy_def_path
    and build a single XML doc that we can search/use for ADMX policy processing

def _load_policy_definitions(path='c:\\Windows\\PolicyDefinitions',
                             language='en-US'):
    '''
    helper function to process all ADMX files in the specified policy_def_path
    and build a single XML doc that we can search/use for ADMX policy processing
    '''
    # Fallback to the System Install Language
    display_language_fallback = INSTALL_LANGUAGE
    t_policy_definitions = lxml.etree.Element('policyDefinitions')
    t_policy_definitions.append(lxml.etree.Element('categories'))
    t_policy_definitions.append(lxml.etree.Element('policies'))
    t_policy_definitions.append(lxml.etree.Element('policyNamespaces'))
    t_policy_definition_resources = lxml.etree.Element(
            'policyDefinitionResources')
    policydefs_policies_xpath = etree.XPath('/policyDefinitions/policies')
    policydefs_categories_xpath = etree.XPath('/policyDefinitions/categories')
    policydefs_policyns_xpath = etree.XPath(
            '/policyDefinitions/policyNamespaces')
    policydefs_resources_localname_xpath = etree.XPath(
            '//*[local-name() = "policyDefinitionResources"]/*')
    policydef_resources_xpath = etree.XPath('/policyDefinitionResources')
    for root, dirs, files in salt.utils.path.os_walk(path):
        if root == path:
            for t_admfile in files:
                admfile = os.path.join(root, t_admfile)
                parser = lxml.etree.XMLParser(remove_comments=True)
                # see issue #38100
                try:
                    xmltree = lxml.etree.parse(admfile, parser=parser)
                except lxml.etree.XMLSyntaxError:
                    try:
                        xmltree = _remove_unicode_encoding(admfile)
                    # TODO: This needs to be more specific
                    except Exception:
                        log.exception('Handle this explicitly')
                        log.error('A error was found while processing admx '
                                  'file %s, all policies from this file will '
                                  'be unavailable via this module', admfile)
                        continue
                namespaces = xmltree.getroot().nsmap
                namespace_string = ''
                if None in namespaces:
                    namespaces['None'] = namespaces[None]
                    namespaces.pop(None)
                    namespace_string = 'None:'
                this_prefix = xmltree.xpath(
                        '/{0}policyDefinitions/{0}policyNamespaces/{0}target/@prefix'.format(namespace_string),
                        namespaces=namespaces)[0]
                this_namespace = xmltree.xpath(
                        '/{0}policyDefinitions/{0}policyNamespaces/{0}target/@namespace'.format(namespace_string),
                        namespaces=namespaces)[0]
                categories = xmltree.xpath(
                        '/{0}policyDefinitions/{0}categories/{0}category'.format(namespace_string),
                        namespaces=namespaces)
                for category in categories:
                    temp_cat = category
                    temp_cat = _updateNamespace(temp_cat, this_namespace)
                    policydefs_categories_xpath(t_policy_definitions)[0].append(temp_cat)
                policies = xmltree.xpath('/{0}policyDefinitions/{0}policies/{0}policy'.format(namespace_string),
                                         namespaces=namespaces)
                for policy in policies:
                    temp_pol = policy
                    temp_pol = _updateNamespace(temp_pol, this_namespace)
                    if 'key' in temp_pol.attrib:
                        temp_pol = _updatePolicyElements(temp_pol, temp_pol.attrib['key'])
                    policydefs_policies_xpath(t_policy_definitions)[0].append(temp_pol)
                policy_namespaces = xmltree.xpath(
                        '/{0}policyDefinitions/{0}policyNamespaces/{0}*'.format(namespace_string),
                        namespaces=namespaces)
                for policy_ns in policy_namespaces:
                    temp_ns = policy_ns
                    temp_ns = _updateNamespace(temp_ns, this_namespace)
                    policydefs_policyns_xpath(t_policy_definitions)[0].append(temp_ns)

                # We need to make sure the adml file exists. First we'll check
                # the passed language (eg: en-US). Then we'll try the
                # abbreviated version (en) to account for alternate locations.
                # We'll do the same for the display_language_fallback (en_US).
                adml_file = os.path.join(
                    root,
                    language,
                    os.path.splitext(t_admfile)[0] + '.adml')
                if not __salt__['file.file_exists'](adml_file):
                    log.info('An ADML file in the specified ADML language '
                             '"%s" does not exist for the ADMX "%s", the '
                             'the abbreviated language code will be tried.',
                             language, t_admfile)

                    adml_file = os.path.join(
                        root,
                        language.split('-')[0],
                        os.path.splitext(t_admfile)[0] + '.adml')
                    if not __salt__['file.file_exists'](adml_file):
                        log.info('An ADML file in the specified ADML language '
                                 'code %s does not exist for the ADMX "%s", '
                                 'the fallback language will be tried.',
                                 language[:2], t_admfile)

                        adml_file = os.path.join(
                            root,
                            display_language_fallback,
                            os.path.splitext(t_admfile)[0] + '.adml')
                        if not __salt__['file.file_exists'](adml_file):
                            log.info('An ADML file in the specified ADML '
                                     'fallback language "%s" '
                                     'does not exist for the ADMX "%s" '
                                     'the abbreviated fallback language code '
                                     'will be tried.',
                                     display_language_fallback, t_admfile)

                            adml_file = os.path.join(
                                root,
                                display_language_fallback.split('-')[0],
                                os.path.splitext(t_admfile)[0] + '.adml')
                            if not __salt__['file.file_exists'](adml_file):
                                msg = ('An ADML file in the specified ADML language '
                                       '"{0}" and the fallback language "{1}" do not '
                                       'exist for the ADMX "{2}".')
                                raise SaltInvocationError(msg.format(language,
                                                                     display_language_fallback,
                                                                     t_admfile))
                try:
                    xmltree = lxml.etree.parse(adml_file)
                except lxml.etree.XMLSyntaxError:
                    # see issue #38100
                    try:
                        xmltree = _remove_unicode_encoding(adml_file)
                    # TODO: This needs to be more specific
                    except Exception:
                        log.exception('Handle this explicitly')
                        log.error('An error was found while processing '
                                  'adml file %s, all policy '
                                  'language data from this file will be '
                                  'unavailable via this module',
                                  adml_file)
                        continue
                if None in namespaces:
                    namespaces['None'] = namespaces[None]
                    namespaces.pop(None)
                policydefs_resources = policydefs_resources_localname_xpath(xmltree)
                for policydefs_resource in policydefs_resources:
                    t_poldef = policydefs_resource
                    t_poldef = _updateNamespace(t_poldef, this_namespace)
                    policydef_resources_xpath(t_policy_definition_resources)[0].append(t_poldef)
    __context__['lgpo.policy_definitions'] = t_policy_definitions
    __context__['lgpo.policy_resources'] = t_policy_definition_resources