A tax of five percent of the gross value at the well is levied upon all oil produced within North Dakota, less the value of any part thereof, the ownership or right to which is exempt from taxation. The tax levied attaches to the whole production, including the royalty interest.