move methods to xml.js