+ if (node->type == XML_ELEMENT_NODE
+ && !strcmp((char *) node->name, "label")
+ && node->parent->type == XML_ELEMENT_NODE
+ && !strcmp((char *) node->parent->name, "container"))
+ {
+ for (xmlNode *child = node->children; child; child = child->next)
+ if (child->type == XML_TEXT_NODE)
+ puts ((char *) child->content);
+ }
+
+ print_labels (node->children);
+ }
+}
+
+static void
+print_attributes (xmlNode * a_node)
+{
+ for (xmlNode *node = a_node; node; node = node->next)
+ {
+ if (node->type == XML_ELEMENT_NODE)
+ {
+ printf ("%s", node->name);
+ for (xmlAttr *attr = node->properties; attr; attr = attr->next)
+ printf (" %s", attr->name);
+ putchar ('\n');
+ }
+
+ print_attributes (node->children);
+ }
+}
+
+static void
+print_attribute (xmlNode *node, const char *attr)
+{
+ for (; node; node = node->next)
+ {
+ const char *s = (char *) xmlGetProp (node, (xmlChar *) attr);
+ if (s)
+ printf ("%s %s\n", node->name, s);
+
+ print_attribute (node->children, attr);