Update XMLTools.js

Updated to accept a document as well as string input
Changed how it was initialized slightly