Check if the document is of type "refType"
The Ref with uncretain type
The Expected Reference Type (this is required because this type is only known at compile time, not at runtime)
Check if the document is of type "refType"