You use a parser Python has two big ones that most use BeautifulSoup and lxml.
To give start example and parse a couple of values.
To give start example and parse a couple of values.
from bs4 import BeautifulSoup soup = BeautifulSoup(open('NPL_2008_LFS_v01_M_v01_A_ILOVAR.xml', encoding='utf-8'), 'xml') title = soup.find('titl') producer = soup.find('producer') print(title.text.strip()) print(producer.attrs.get('affiliation'))
Output:NPL_2008_LFS_v01_M
International Labour Organization