before a new child is appended it is first duplicated therefore the new child is a completely new copy which can be modified without changing the node which was passed to this function if the node passed has children itself they will be duplicated as well which makes it quite easy to duplicate large parts of a xml document the return value is the appended child if you plan to do further modifications on the appended child you must use the returned node 