I have thousands of nodeset such as below and i would like to flatten it into tibble/dataframe so i need to create a function that can read xml children recursively.
names of the tibbles should be from the tag (ie, code, name, type, etc)
specially node 6 and 7
file is downloaded from "https://development-finance-codelists.oecd.org/Codeslist.aspx and
nodes's path is "//codelist[@name='Recipient']/*/codelist-item"
{xml_nodeset (13)}
[1] <code>55</code>
[2] <name>\n <narrative>Türkiye</narrative>\n <narrative xml:lang="fr">Türkiye</narrative>\n</name>
[3] <type>Country</type>
[4] <iso-alpha-3-code>TUR</iso-alpha-3-code>
[5] <iso-alpha-2-code>TR</iso-alpha-2-code>
[6] <region>\n <region-code>10010</region-code>\n <name>\n <narrative>Europe</narrative>\n <narrative xml:lang="fr" ...
[7] <income-group>\n <code>10019</code>\n <name>\n <narrative>UMICs</narrative>\n <narrative xml:lang="fr">PRITS</n ...
[8] <wb-income-group>\n <code>10047</code>\n <name>\n <narrative>WB-UM</narrative>\n </name>\n</wb-income-group>
[9] <land-locked>0</land-locked>
[10] <sids>0</sids>
[11] <fragile-state>0</fragile-state>
[12] <crs>1</crs>
[13] <tossd>1</tossd>