I believe you are correct in your assessment, but I have not tried that code above. I created a form not that long ago that did a lot of work with a custom task pane and moved data captured from there over. This is what I did. This method will take a string of XML and a the path to where it should be inserted.
Sub CreateRow(sXML, sParentNodePath)
'Create a new row
dim oXml
set oXml = XDocument.CreateDOM()
oXml.async = false
oXml.loadXML(sXML)
'add the row to the DOM
XDocument.DOM.selectSingleNode(sParentNodePath).appendChild(oXml.documentElement)
End Sub
For instance if my XML structure was <Policies><Policy></Policy><Policy></Policy></Policies>
sXML = "<Policy></Policy>"
sParentNodePath = "//Policies"
From a maintainability standpoint this code is not the best, I personally do not like it because the XML string gets hard coded into your script or managed code and if you schema gets modified, you must remember to go modify this code.
Another thing you could look into is the Call XDocument.View.ExecuteAction using the "xCollection::insert" parameter. This method does not suffer from the disadvantage that I mentioned above.
Jason
http://www.k2distillery.com/