Just to confirm I understand your request: You want to route the caller to a specific destination or CSQ based on their ANI?
If that is accurate, you will need to figure out a common way to store the ANI so you can match it in XML or SQL. This is somewhat easy within the U.S. as NANP is a fixed-length dial plan. Countries with variable-length dial plans make more challenging.
You can use XML (and a single file) by just having different elements for each ANI pattern and use XPath to get the appropriate child element(s) that explain the final destination to route the call to.
Likewise with SQL if you have premium: You can run a SQL query and get the result back.
If you are going to have hundreds, or more, of these ANI-based routing scenarios you will likely need to use SQL. CCX has to load the entire XML file into memory each time the script is called so this could become a problem if the file is overly large and/or a lot of concurrent executions occur.