Ported Print::validate() to XS