import xml.etree.ElementTree as ET
from pathlib import Path, PurePath


def getFileName(node)->str:
    id=node.attrib['id']
    node_file_name=node.find('{http://www.mapinfo.com/mxp}FileName')
    if node_file_name is None:
        return None
    filename=node_file_name.text
    return filename
name_file='E:\\Support\\Terix\\Repo\\Maps\\Russia.mws'
name_file=r"E:\Support\WorExample\WorCopy\CopyMws\набор.mws"
tree = ET.parse(name_file)
root = tree.getroot()
string_byte_xml= ET.tostring(root, encoding='utf-8')
path_folder_mws=Path(name_file).parent
#textt=ET.tostring(tree, encoding='utf-8')
#nodes_TABFileDataSourceDefinition=tree.findall('/{http://www.mapinfo.com/mxp}DataSourceDefinitionSet/{http://www.mapinfo.com/mxp}TABFileDataSourceDefinition')
nodes_TABFileDataSourceDefinition=tree.findall('/{http://www.mapinfo.com/mxp}DataSourceDefinitionSet')
for node in nodes_TABFileDataSourceDefinition:
    file_name=getFileName(node)
    full_path=str(path_folder_mws.joinpath(file_name))
    abs_path=PurePath(full_path)
    jkl=0
jkl=0