>>> container = tree.xpath("//container")[0] >>> container.attrib {'type': 'box', 'label': 'Box'}