if( $value->isa( "Node" ) ) { # It's okay to put $value into the parent attribute }