In the project I am working, I need to automatize the creation of an XML document depending on the user input. The part of using the user input to modify the xml document is okay for me but I am new in creating xml documents from scratch in R
I am wondering if an XML document like the one below can be generated in R using the XML or xml2 packages. So far, I have explored the newXMLdoc, xml_new_document and xml_new_root functions but I am not familiar with all the syntax needed to create such an xml file (which should be saved in a local path once finished)
<session>
<modelVersion>1.0.0</modelVersion>
<products>
<product>
<refNo>1</refNo>
<uri>S1A_IW_GRDH_1SDV_20190818T175529_20190818T175554_028627_033D25_22ED.zip</uri>
<productReaderPlugin>class org.esa.s1tbx.io.sentinel1.Sentinel1ProductReaderPlugIn</productReaderPlugin>
</product>
<product>
<refNo>2</refNo>
<uri>S2A_MSIL1C_20190823T061631_N0208_R034_T42TXS_20190823T081730.zip</uri>
<productReaderPlugin>class org.esa.s2tbx.dataio.s2.ortho.plugins.Sentinel2L1CProduct_Multi_UTM42N_ReaderPlugIn</productReaderPlugin>
</product>
</products>
<views/>
</session>