Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method UpdateNVT (MdlAttrElement attr, Duration value) 
 | 
{ 
 | 
  TextBody: 
 | 
  [* 
 | 
    if( this.NeedUpdateNVTValue() ) 
 | 
    { 
 | 
      nvt := NamedValueTreeXMLStreamer::FromString( this.NVTValue() ); 
 | 
      sourcenode := nvt.Root(); 
 | 
      handle := nvt.GetHandle( attr.Name() ); 
 | 
      nvfind := select( sourcenode.Children(), Elements, e, e.Name() = handle.Name() ); 
 | 
      if( not isnull( nvfind ) ) 
 | 
      { 
 | 
        nvfind.SetValue( value ); 
 | 
      } 
 | 
      else 
 | 
      { 
 | 
        nv := sourcenode.AddChild( handle ); 
 | 
        nv.SetValue( value ); 
 | 
      } 
 | 
       
 | 
      this.NVTValue( NamedValueTreeXMLStreamer::ToString( nvt, sourcenode ) ); 
 | 
    } 
 | 
  *] 
 | 
} 
 |