append.xmlNode {XML} | R Documentation

## Add children to an XML node

### Description

This appends one or more XML nodes as children of an existing node.

### Usage

    append.XMLNode(to, ...)
    append.xmlNode(to, ...)

### Arguments

`to` | the XML node to which the sub-nodes are to be added.
`...` | the sub-nodes which are to be added to the `to` node. If this is a `list` of `XMLNode` objects (e.g. create by a call to `lapply`), then that list is used.

### Value

The original `to` node containing its new children nodes.

### Author(s)

Duncan Temple Lang

### References

http://www.w3.org/XML, http://www.jclark.com/xml, http://www.omegahat.org

### See Also

`[<-.XMLNode` `[[<-.XMLNode` `[.XMLNode` `[[.XMLNode`

### Examples

    ## Not run:
       tmp <-  lapply(references, function(i) {
                                      if(!inherits(i, "XMLNode"))
                                        i <- xmlNode("reference", i)
                                      i
                                  })
       r[["references"]] <- append.xmlNode(r[["references"]],tmp)
    ## End(Not run)

[Package XML version 0.97-7 Index]