The XMM cluster survey: optical to X-ray scaling relations