I need to convert docstrings into XML data and append this XML data in the begining of the already existing XML file.
Data to convert into XML looks something like this:
"""
Sample Description:
Sample author: abc
sample version: x.1
multiple lines like this
"""
string = __doc__
gives me doc string, but how to proceed further, converting to XML and appending into the begining of the already existing XML file?
The XML file should look like this:
<sample-description
sample-author="abc"
sample-version="x.1">
multiple-lines
</sample-description>