I've been looing around for a method to remove an element from an XML document,while keeping the contents, using Python, but i haven't been able to find an answer that works.
Basically, i received an XML document in the following format (example):
<root>
<element1>
<element2>
<text> random text </text>
</element2>
</element1>
<element1>
<element3>
<text> random text </text>
</element3>
</element1>
</root>
What i have to do is to merge element2 and element3 into element1 such that the output XML document looks like:
<root>
<element1>
<element2>
<text> random text </text>
</element2>
<element3>
<text> random text </text>
</element3>
</element1>
</root>
I would appreciate some tips on my (hopefully) simple problem.
Note: I am somewhat new to Python as well, so bear with me.