Blockchain technology provides a new decentralized approach for archiving digital resources. It has huge potential to enhance applications in many industries such as finance, healthcare, media, and education. This is supported by the Blockchain key features like data protection and smart contracts. However, although smart contracts present great opportunities for a range of domains, there are several problems related to their designing and implementation. Specifically, smart contracts assume ideal defined, but this is not always the case. If one step of contract designing is executed incorrectly, the smart contract will be implemented wrongly. Because the content of blocks can be expressed in any format, for example, in XML, smart contracts can be defined and deployed using XQuery Language. XQuery makes data contained in the instance available to other applications. In this paper, we proposed a security model that utilizes the XQuery syntax to define smart contracts. The defined contracts implicitly specify the rules on the Blockchain resources and are integrated into XML schema itself, which can be applied to instance objects without any change. To ground our conceptual idea, a prototype implementation is specifically developed for this research. The developed system consists of three main components while the User Interface Tool allows end-users to design the contracts using the XQuery with SQL-like syntax. The Smart Contracts Repository stores the contracts generated by the interface tool to be applied later by the Contracts Applier to the Blockchain for enforcement. We found that the specified contracts can support complex rules over the resources when combining and ends up with reusable contracts, which efficiently simplify the security administration and achieve access control over the Blockchain blocks.