getting equivalent document to a node