I want to insert aaa into the parent "holding category" like the following:
<ns2:holding category="BASIC">
<ns2:pieceDesignation>10010194589</ns2:pieceDesignation>
<temporaryLocation>aaa</temporaryLocation>
<ns2:cost>
Here's the code I've written:
temporarylocation = Element("temporaryLocation")`
temporarylocation.text = 'aaa'
holdingcategory.insert(1,temporarylocation)
print(ET.tostring(holdingcategory))
However, the the result I've received looks like this:
<ns2:pieceDesignation>10010194589</ns2:pieceDesignation>
<temporaryLocation>aaa</temporaryLocation><ns2:cost>
with ns2:cost followed immediately after temporaryLocation instead of starting from the next line.