xml_encode() and xml_decode() convert between XML strings and element-shaped DValue values without schema validation.
<book id="b1" type="reference"><title>UCE & XML</title><chapter number="1">Structural conversion without schema validation.</chapter></book>
{"attrs": {"id": "b1", "type": "reference"}, "children": [{"name": "title", "text": "UCE & XML"}, {"attrs": {"number": "1"}, "name": "chapter", "text": "Structural conversion without schema validation."}], "name": "book"}
<payload><count>3</count><title>Hello</title></payload>
Input XML:
<note priority="high"><to>UCE</to><body><![CDATA[5 < 6]]></body><symbol>AB</symbol></note>
Decoded DValue:
{"attrs": {"priority": "high"}, "children": [{"name": "to", "text": "UCE"}, {"name": "body", "text": "5 < 6"}, {"name": "symbol", "text": "AB"}], "name": "note"}