code: def addObjectFromXML(xmlObject, XMLToObjectFunc,
                       topLevelName, idKey, updateList):
      
  
      # Get the current object to update
      contentElement = getNodeByName(xmlObject, "content")
      objectNode = getNodeByName(contentElement, topLevelName)
      dupObjects = None
      newObject = XMLToObjectFunc(objectNode)
      try:
          kwargs = {idKey: getattr(newObject, idKey)}
          dupObjects = type(newObject).objects.filter(**kwargs)
      except type(newObject).DoesNotExist:
          pass
      if dupObjects and dupObjects.count() > 1:
          raise Exception(
              "Duplicate object with identifier %s" % getattr(newObject, idKey)
          )
      newObject.save()
      return newObject
docs: Handle adding or updating the Queue.  Based on XML input.