Parse a resource

        :param resource: Element rerpresenting a work
        :param type: basestring, etree._Element
        :param parent: Parent of the object
        :type parent: XmlCtsTextgroupMetadata
        :param _cls_dict: Dictionary of classes to generate subclasses

def parse(cls, resource, parent=None, _with_children=False):
        """ Parse a resource

        :param resource: Element rerpresenting a work
        :param type: basestring, etree._Element
        :param parent: Parent of the object
        :type parent: XmlCtsTextgroupMetadata
        :param _cls_dict: Dictionary of classes to generate subclasses
        """
        xml = xmlparser(resource)
        o = cls(urn=xml.get("urn"), parent=parent)

        lang = xml.get("{http://www.w3.org/XML/1998/namespace}lang")
        if lang is not None:
            o.lang = lang

        for child in xml.xpath("ti:title", namespaces=XPATH_NAMESPACES):
            lg = child.get("{http://www.w3.org/XML/1998/namespace}lang")
            if lg is not None:
                o.set_cts_property("title", child.text, lg)

        # Parse children
        children = []
        children.extend(_xpathDict(
            xml=xml, xpath='ti:edition',
            cls=cls.CLASS_EDITION, parent=o
        ))
        children.extend(_xpathDict(
            xml=xml, xpath='ti:translation',
            cls=cls.CLASS_TRANSLATION, parent=o
        ))
        children.extend(_xpathDict(
            xml=xml, xpath='ti:commentary',
            cls=cls.CLASS_COMMENTARY, parent=o
        ))

        _parse_structured_metadata(o, xml)

        if _with_children:
            return o, children
        return o