implement nested XML parsing