intermediate steps towards xml parsing reorganization