XML attribute analysis
Regarding the primary question, your code is very close to being a well-defined function. Simply wrap the entire code in a function, making filename the right argument, fpath the left argument, and allUsed the result like so (with a couple of unreference lines omitted): 

 GetAllUsed←{
         filename←⍵
         fpath←⍺
         getxml←{⎕XML⊃⎕NGET ⍵}
         doc←getxml filename
         attrib←↑doc[;4]
         col←{attrib[;(attrib[1;;1]⍳⊂⍵);2]}
         oot←((⍴fpath)↑¨col'fname')∊⊂fpath
         cn←oot/(col'callee_name')
         mn←oot/(col'method_name')
         ∪(⍉↑(cn mn))[⍋cn;]
     }


I cannot envision a scenario where one might not want it as a dyadic function, or where one would want to introduce a global variable of any sort. I prefer the file name as the right argument, leaving the opportunity to make the left argument optional (possibly having it default to the first few path segments of the right arg?)

Regarding the actual code, the biggest issue is that it relies on the set of attributes for each MemberCall element being exactly the same. An additional or missing attribute will cause the code to fail, with an index error most likely, or produce a bad result. 

If it is indeed the case that the attribute sets are identical, then a much simpler approach can be taken by restructuring the attributes for all elements into a single matrix of name/value pairs. There is no need to construct a rank-3 array as is done currently.

If this is not the case, then one approach is to define a little getter function that picks out a given attribute for each element. This function can handle the issue of missing or extra attributes, attributes in any order, etc.