XML:append(name [, text [, attributes [, go]]])
Add a new element to the document as a sibling immediately after the current element.
If text is specified, the element will contain a text node that is set to the value of the text string.
The optional attributes argument is a table that should contain a set of name/value pairs. The table will be used to set the attributes of the new XML element.
The fourth argument is a boolean value. If it has the value true the document position will be set to be the newly created element. Otherwise the document position will not be changed.
attrs={}
attrs.hostname='127.0.0.1'
attrs.port='5480'
attrs.database='system'
doc = xml.parse('<options><date>2011-07-01</date></options>')
doc:goPath('/options/date')
doc:append('connection', null, attrs, true)