import xml.dom.minidom                          #   Module used in xml parsing
##  Begin XML Remote Button Map Configuration Input
xmlDoc=xml.dom.minidom.parse("buttonMap.xml")                       #   Open the xml button map document
root=xmlDoc.childNodes[0]
remotes=root.childNodes
for remote in xmlDoc.getElementsByTagName('remote'):                #   Traverse each remote node
    prefixNode=remote.getElementsByTagName('eventPrefix')           #   Retrieve remote's prefix to be used
    prefix= prefixNode[0].childNodes[0].data                        #       in the event name
    for button in remote.getElementsByTagName('button'):            #   Traverse each remote's button
        codeNode=button.getElementsByTagName('code')                #   Retrieve the event code
        code=codeNode[0].firstChild.data
        eventNode=button.getElementsByTagName('event')              #   Retrieve the event name
        event=eventNode[0].firstChild.data
        xbcdrc_mapping = eg.result.thread.xbcdrc_mapping
        xbcdrc_mapping[str(code)]=str(prefix+'_'+event)
##  END XML Remote Button Map Configuration Input
