I have a XML-file:
<listOfSpecies>
<species metaid="MAM00001c" sboTerm="SBO:0000247" id="MAM00001c" name="(-)-trans-carveol" compartment="c" initialConcentration="0" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false" fbc:charge="0" fbc:chemicalFormula="C10H16O">
<annotation>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:vCard="http://www.w3.org/2001/vcard-rdf/3.0#" xmlns:vCard4="http://www.w3.org/2006/vcard/ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/" xmlns:bqmodel="http://biomodels.net/model-qualifiers/">
<rdf:Description rdf:about="#MAM00001c">
<bqbiol:is>
<rdf:Bag>
</rdf:Bag>
</bqbiol:is>
</rdf:Description>
</rdf:RDF>
</annotation>
</species>
...
</listOfSpecies>
and a txt-file:
name="(-)-trans-carveol" fbc:charge="0" fbc:chemicalFormula="C10H16O"
<rdf:li rdf:resource="https://identifiers.org/kegg.compound/C11409"/>
<rdf:li rdf:resource="https://identifiers.org/pubchem.compound/94221"/>
<rdf:li rdf:resource="https://identifiers.org/lipidmaps/LMPR0102090005"/>
<rdf:li rdf:resource="https://identifiers.org/inchi/InChI=1S/C10H16O/c1-7(2)9-5-4- 8(3)10(11)6-9/h4,9-11H,1,5-6H2,2-3H3/t9-,10+/m0/s1"/>
<rdf:li rdf:resource="https://identifiers.org/inchikey/BAVONGHXFVOKBV-VHSXEESVSA-N"/>
<rdf:li rdf:resource="https://identifiers.org/metanetx.chemical/MNXM45735"/>
and I would like to insert all the 'rdf:li rdf:resource' elements in the txt-file for each species/name between the rdf:Bag</rdf:Bag>tags in the xml-file. So far I have been playing with minidom, beautifulsoup, elementree and treating the xml-file as a regular file and I have not found anything that works so far. Can anyone point me in the right direction?