refactorings in XML parsing (for processing remote resources)