Node.parent
Gets or sets the parent node of the current node. A nil value means the Node has no parent.
Example
--! luart-extensions
import xml
-- Create a root node
local root = xml.Node("root")
-- Add a child node
local child = root:add("greeting", "Hello")
-- Access the parent of the child
print(child.parent.name) -- Output: root
-- Reassign the parent (move child under a new node)
local newParent = xml.Node("newroot")
child.parent = newParent
print(child.parent.name) -- Output: newroot