Welcome to the site depunched !!
Check the cam and cam bearings , usually in the XR's that is the cause of the noise , if it is on fact a knocking and not "tapping/ticking" which would be valve lash is loose and needing adjustment , hopefully its the tapping not knocking your hearing as if it is knocking you would most likely be needing to find a new cam tower , or possibly even a new head which could get expensive
Also verify the noise is up top in the head , not in the cylinder , if its lower it could be the timing chain or tensioner that is bad
krupster , the same would apply for your issue