1. i've opened up an xml document in javascript
  2. i determine a node (a parent) i want to append a new node (child) to
  3. i append the child to the parent node
for some reason, when the child is appended, it is without a closing tag. is there something specific i'm missing when appending a new node to an xml document that will apply a closing tag?

here's the very simple javascript i'm using...
Code JavaScript:
// 'parent' is the node i'm wanting to append the new child node to in the xml document
 
var device = myXML.createElement('device');
/*
setting some attributes
*/
parent.appendChild(device);

and here's the XML before i append...
Code XML:
<config>
    <interface name="Interface 1">
        <device name="Device 1">
            <device name="Device 2"> <!--- the node i want to append to --->
                <device name="Device 3">
                    <property name="Property 1"></property>
                </device>
            </device>
        </device>
        <device name="Device 4"></device>
        <device name="Device 5"></device>
        <device name="Device 6"></device>
    </interface>
</config>

after the append...
Code XML:
<config>
    <interface name="Interface 1">
        <device name="Device 1">
            <device name="Device 2"> <!--- the node i want to append to --->
                <device name="Device 3">
                    <property name="Property 1"></property>
                </device>
            </device>
        <device name="Device 7"></device> <!--- where the new node is wrongly placed --->
        <device name="Device 4"></device>
        <device name="Device 5"></device>
        <device name="Device 6"></device>
    </interface>
</config>

and what it should look like...
Code XML:
<config>
    <interface name="Interface 1">
        <device name="Device 1">
            <device name="Device 2"> <!--- the node i want to append to --->
                <device name="Device 3">
                    <property name="Property 1"></property>
                </device>
                <device name="Device 7"></device> <!--- the new node --->
            </device>
        </device>
        <device name="Device 4"></device>
        <device name="Device 5"></device>
        <device name="Device 6"></device>
    </interface>
</config>