次の文字列があります。
"Sweden, Västmanland, Västerås"
"Sweden, Dalarna, Leksand"
"Ireland, Cork, Cobh"
"Ireland, Clare, Boston"
"Ireland, Cork, Baltimore"
"Sweden, Dalarna, Mora"
次のようにxmlに変換したい:
<?xml version="1.0" ?>
<data>
<country name = "Ireland">
<region name = "Clare">
<settlement name = "Boston"/>
</region>
<region name = "Cork">
<settlement name = "Baltimore"/>
<settlement name = "Cobh"/>
</region>
</country>
<country name = "Sweden">
<region name = "Dalarna">
<settlement name = "Leksand"/>
<settlement name = "Mora"/>
</region>
<region name = "Västmanland">
<settlement name = "Västerås"/>
</region>
</country>
</data>
不必要に車輪を再発明するために、この変換を行うのに役立つpython3の組み込みライブラリは何ですか?