matches( $s , '^[A-Z0-9]{18}[0-9]{2}$' )
xs:anyURI( 'http://standards.iso.org/iso/17442' )
( if ( string-length( $s ) > 13 ) then 10000000000000 * lei-fn:_checksum-97-10( substring( $s , 1 , string-length( $s ) - 13 ) ) + xs:integer( substring( $s , string-length( $s ) +1 - 13 , 13 ) ) else xs:integer( substring( $s , 1 , string-length( $s ) ) ) ) mod 97
not( lei-fn:validate-format( $s ) ) or ( lei-fn:_checksum-97-10( string-join( ( for $c in string-to-codepoints( $s ) return xs:string( if ( $c <= 57 ) then $c - 48 else $c - 55 ) ) , '' ) ) = 1 and not( matches( $s , "(00|01|99)$" ) ) )