Update
Updates the value of an XML tag, or inserts the tag when it does not exist, under the nodes an XPath selects.
The Update action in the XML folder changes an XML document. Under every node the XPath expression selects, it looks for the tag you name: if the tag exists, its value is replaced; if it does not, a new tag with that value is added. You get the new XML both as text and as an .xml file.
Update was previously called XML Update.
Add the action
In the Process Designer toolbox, open XML and pick Update (or type Update in the search box).

Inputs and outputs
| Field | Direction | Type | Required | What to put / what you get |
|---|---|---|---|---|
| Input XML string | Input | Text | No* | The XML as text. |
| Input XML file | Input | File | No* | An XML file. Used only when Input XML string is empty. |
| XPath expression | Input | Text | Yes | Selects the node(s) to work under, for example /bookstore/book[1]. |
| XML tag | Input | Text | Yes | The tag to update or insert, for example title. |
| New value | Input | Text | Yes | The new value of the tag. |
| File name | Input | Text | No | Name of the output file. .xml is added for you. Empty: Document_Generated_by_PROCESIO.xml. |
| String result | Output | Text | No | The updated XML as text. |
| File result | Output | File | No | The updated XML as an .xml file. |
* Fill one of the two: Input XML string or Input XML file.
Example
Input XML string:
<bookstore>
<book><title lang="en">Harry Potter</title><price>29.99</price></book>
<book><title lang="en">Learning XML</title><price>39.95</price></book>
</bookstore>| XPath expression | XML tag | New value | String result (changed part) |
|---|---|---|---|
/bookstore/book[1] | title | The Great Gatsby | first book: <title lang="en">The Great Gatsby</title> (the tag exists, so it is updated) |
/bookstore/book[1] | author | J. K. Rowling | first book: …<price>29.99</price><author>J. K. Rowling</author> (the tag is new, so it is added last) |
//book | price | 10 | both books: <price>10</price> |
//magazine (no match) | price | 10 | empty, and File result is empty too |
With File name books, File result is books.xml.
Good to know
- The tag is searched among the selected node and all its descendants, and every matching tag is updated. Only tags that hold a value (no child elements) are updated.
- A new tag is added as the last child of each selected node. Attributes are kept when a value is updated.
- When the XPath matches nothing, the step still succeeds but both outputs are empty.
- XML that is not well-formed, or an invalid XPath, fails the step with
Input XML or XPath was not valid. - To add or update many tags in one step, use XML Processor.

