Inserting a block of XML into existing XML

I have a XML “writer” that will create (using AIR) a file on my desktop with a block of XML data. This tool will also load a XML file. What I need help with is getting it to add subsequent blocks of XML data before the closing tag. Any help would be great.


<open>
     <block1>
     </block1>
     <block2>
     </block2>
     /*This is where I would like to insert another block of XML*/
</open>