[Solved] Appending images to an .fodt file

Supreet Singh Asks: Appending images to an .fodt file
I have been trying to automate my assignments. What I have decided is that, the program will add the images to the “.fodt” file using the xml code blocks.

What I have understood online, is that I have to base64 encode the image then add it in the xml tags, but I am not able to wrap my head around the .fodt xml

Code:
<office:body>
 <office:text>
   <text:sequence-decls>
     <text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>
     <text:sequence-decl text:display-outline-level="0" text:name="Table"/>
     <text:sequence-decl text:display-outline-level="0" text:name="Text"/>
     <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
     <text:sequence-decl text:display-outline-level="0" text:name="Figure"/>
   </text:sequence-decls>
   <text:p text:style-name="P1">Hello World </text:p>

This is how the xml for the .fodt file looks and this file has only Hello World inside it, the xml for this document is very long, how am I supposed to add the code block for an image, in this xml file?

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.