if (xmlNode != null) {
Object topicsObject = xmlNode.getElement("topic");
if (topicsObject instanceof java.util.List) {
java.util.List subtopics = (java.util.List) topicsObject;
for (int i = 0; i < subtopics.size(); i++) {
XmlNode xmlSubNode = (XmlNode) subtopics.get(i);
String id = xmlSubNode.getAttribute("id");
String title = xmlSubNode.getAttribute("title");
Object subs = xmlSubNode.getElement("topic");
int subtopicCount = subs instanceof java.util.List ? ((java.util.List)subs).size() : 0;
TopicInfo topicInfo = new TopicInfo(id, title, subtopicCount);
DefaultMutableTreeNode node = new DefaultMutableTreeNode(topicInfo);
this.treeModel.insertNodeInto(node, root, root.getChildCount());