I need an XPath to fetch all ChildNodes ( including Text Element, Comment Element & Child Elements ) without Parent Element. Any help
Sample Example:
<
From the documentation of XPath ( http://www.w3.org/TR/xpath/#location-paths ):
child::*selects all element children of the context node
child::text()selects all text node children of the context node
child::node()selects all the children of the context node, whatever their node type
So I guess your answer is:
$doc/PRESENTEDIN/X/child::node()
And if you want a flatten array of all nested nodes:
$doc/PRESENTEDIN/X/descendant::node()