def ImportUcsSession(filePath, key):
	from UcsBase import UcsUtils, WriteUcsWarning, UcsValidationException
	if filePath is None:
		raise UcsValidationException("filePath parameter is not provided.")
	if key is None:
		raise UcsValidationException("key parameter is not provided.")
	if not os.path.isfile(filePath) or not os.path.exists(filePath):
		raise UcsValidationException('[Error]: File <%s> does not exist ' % (filePath))
	doc = xml.dom.minidom.parse(filePath)
	topNode = doc.documentElement
	if topNode is None or topNode.localName != UcsLoginXml.UCS_HANDLES:
		return None
	if (topNode.hasChildNodes()):
		childList = topNode.childNodes
		childCount = len(childList)
		for i in range(childCount):
			childNode = childList.item(i)
			if (childNode.nodeType != Node.ELEMENT_NODE):
				continue
			if childNode.localName != UcsLoginXml.UCS:
				continue
			lName = None
			lUsername = None
			lPassword = None
			lNoSsl = False
			lPort = None
			if childNode.hasAttribute(UcsLoginXml.NAME):
				lName = childNode.getAttribute(UcsLoginXml.NAME)
			if childNode.hasAttribute(UcsLoginXml.USER_NAME):
				lUsername = childNode.getAttribute(UcsLoginXml.USER_NAME)
			if childNode.hasAttribute(UcsLoginXml.PASSWORD):
				lPassword = UcsUtils.DecryptPassword(childNode.getAttribute(UcsLoginXml.PASSWORD), key)
			if childNode.hasAttribute(UcsLoginXml.NO_SSL):
				lNoSsl = childNode.getAttribute(UcsLoginXml.NO_SSL)
			if childNode.hasAttribute(UcsLoginXml.PORT):
				lPort = childNode.getAttribute(UcsLoginXml.PORT)
			if ((lName is None) or (lUsername == None) or (lPassword == None)):
				continue
			try:
				handle = UcsHandle()
				handle.Login(name=lName, username=lUsername, password=lPassword, noSsl=lNoSsl, port=lPort)
			except Exception, err:
				WriteUcsWarning("[Connection Error<%s>] %s" % (lName, str(err)))