convert a text file into xml file

I have a text file that looks like this

Country Brazil

Continent South America

Capital Brazilia

Items location Quantity

Automobile1 Zone1 10

Automobile2 Zone10 15

Automobile3 Zone21 0

I need to convert it to a xml likes this.

I looked for help here How to convert .txt file into xml file using python? but it is a different scenario.

<xml version>
<Country="Brazil" Continent="South America" Capital="Brazilia">
<Items="Automobile1" Location="Zone1",Quantity="10"/>
<Items="Automobile2" Location="Zone10",Quantity="15"/>
<Items="Automobile3" Location="Zone21",Quantity="0"/>