I am sorry to say that but as I see, there are not a lot of answers when there are questions regarding XML as text input.
Perhaps can somebody make some suggestions regarding where can I search for such answers (books, other forums ...)?
Try this book:
Designer's Guide to Adobe InDesign and XML, A: Harness the Power of XML to Automate your Print and Web Workflows
by James Maivald
has downloadable examples
Retrieving data ...