original_string: public static function is_valid_preset($xml) {
          $dom = new DOMDocument();
          if (!$dom->loadXML($xml)) {
              return false;
          } else {
              $val = @$dom->schemaValidate(__DIR__.'/../role_schema.xml');
              if (!$val) {
                  return false;
              }
          }
          return true;
      }
code: public static function is_valid_preset($xml) {
          $dom = new DOMDocument();
          if (!$dom->loadXML($xml)) {
              return false;
          } else {
              $val = @$dom->schemaValidate(__DIR__.'/../role_schema.xml');
              if (!$val) {
                  return false;
              }
          }
          return true;
      }
code_tokens: public static function is_valid_preset ( $ xml ) { $ dom = new DOMDocument ( ) ; if ( ! $ dom -> loadXML ( $ xml ) ) { return false ; } else { $ val = @ $ dom -> schemaValidate ( __DIR__ . '/../role_schema.xml' ) ; if ( ! $ val ) { return false ; } } return true ; }
docstring: Is this XML valid role preset?
  
  @param string $xml
  @return bool
docstring_tokens: Is this XML valid role preset?