Thanks Jean-Pierre & Kevin!
Adding xmlerror=null as an option doesn't solve the issue, it's just a workaround to make xmlvalidate return null in case of an error.
Jean-Pierre, "prueba" is needed because if you don't add a name to the DOCTYPE declaration, xmlvalidate raises an exception: "Expected quoted string"