Fixed bug in adding a XML DOM child element