ProcessingInstruction.ownerDocument as XMLDocument
This is inherited from the XMLNode object.
fn.head(xdmp.value("//example")).ownerDocument.firstChild.nodeName