I'm trying to add a new node to XML file in Inno Setup. The node added correctly but the newline before the next tag is removed or no newline added. Here is my adding node code:
NewNode := XMLDoc.createElement('Test');
XMLDoc.setProperty('SelectionLanguage', 'XPath');
RootNode := XMLDoc.selectSingleNode('//Configuration/AppSettings');
RootNode.appendChild (NewNode);
RootNode.lastChild.text :='New Node';
Here is my XML file:
<Configuration>
<AppSettings Name="General Settings">
<StartTime/>
<StopTime/>
<TimeBetweenTests>30</TimeBetweenTests>
<Port>600</Port>
<Test>New Node</Test></AppSettings>
</Configuration>
I was expecting the tag
</AppSettings>
to stay in the newline as it was before the addition of the new node. How could I add a newline to keep the format more readable?