Amazon Interview Question

How would you implement document.querySelectorAll manually using recursion?