I know the basics but i've mostly dealt with modification of existing XML files in the past, not creating one from the scratch.
Also, i figured .appendChild(), but when i read XML file, append some element and write the modified XMl into a file, i lose the declaration for some reason.
This:
Code: Select all
<?xml version="1.0"?>
<root>
<something1></something1>
</root>
Code: Select all
<root>
<something1></something1>
<something2></something2>
</root>
Any help appreciated.