Fixed a bug while moving the node to a new parent and the @NodeName has not been defined in the document