3D/2D registration is a key technique for intraoperative guidance. In existing deep learning based registration methods, image features were extracted through the network to regress the corresponding pose transformation parameters. This kind of method relies on real samples and their corresponding 3D labels for training, however, this part of expert-annotated medical data is scarce. In the alternative solution, the network was trained with Digital Reconstructed Radiography (DRR) images, which struggled to keep the original accuracy on Xray images due to the differences of image features across domains. For the above problems, an Unsupervised Cross-Domain Transfer Network (UCDTN) based on self-attention was designed. Without relying on Xray images and their 3D spatial labels as the training samples, the correspondence between the image features captured in the source domain and spatial transformations were migrated to the target domain. The public features were used to reduce the disparity of features between domains to minimize the negative impact of cross-domain. Experimental results show that the mTRE (mean Registration Target Error) of the result predicted by UCDTN is 2.66 mm, with a 70.61% reduction compared to the model without cross-domain transfer training, indicating the effectiveness of UCDTN in cross-domain registration tasks.