I'd suggest trying to write code to produce the XML document and only then figure out what data structure you need to do it. (There are so many variations in what XML can look like that your task doesn't tell me what a good data structure would be for your problem.)