# xmlRemove

Remove an element or a list of elements from their parents

## Calling Sequence

                xmlRemove(elems)

## Arguments

elems

  elems, a XMLElem or a XMLSet (result of XPath query) or a XMLlist (a children list)

## Description

Detach one or several elements from their parents. The detached elements are definitly lost.

## Examples

        doc = xmlReadStr("<root><a>Hello</a><b>Scilab</b><a>World</a></root>");

        // Remove all the <a>
        xp = xmlXPath(doc, "//a");
        xmlRemove(xp);
        xmlDump(doc)
        xmlDelete(doc);

        // Remove the first element
        doc = xmlReadStr("<root><a>Hello</a><b>Scilab</b><a>World</a></root>");
        xmlRemove(doc.root.children(1));
        xmlDump(doc)

        //Remove all the root children
        xmlRemove(doc.root.children);
        xmlDump(doc)

        xmlDelete(doc);

## See Also

- XMLObjects

## History

5.4.0
XML module introduced.