Refactors process_XML to XMLNode