code: def _parse_element_r(self, el, specials, refs, id=None, element_cls=Paragraph):
          
          elements = []
          if el.tag in {etree.Comment, etree.ProcessingInstruction}:
              return []
          # if el in refs:
          #     return [element_cls('', references=refs[el])]
          if el in specials:
              return specials[el]
          id = el.get('id', id)
          references = refs.get(el, [])
          if el.text is not None:
              elements.append(element_cls(six.text_type(el.text), id=id, references=references))
          elif references:
              elements.append(element_cls('', id=id, references=references))
          for child in el:
              # br is a special case - technically inline, but we want to split
              if child.tag not in {etree.Comment, etree.ProcessingInstruction} and child.tag.lower() == 'br':
                  elements.append(element_cls(''))
  
              child_elements = self._parse_element_r(child, specials=specials, refs=refs, id=id, element_cls=element_cls)
              if (self._is_inline(child) and len(elements) > 0 and len(child_elements) > 0 and
                      isinstance(elements[-1], (Text, Sentence)) and isinstance(child_elements[0], (Text, Sentence)) and
                      type(elements[-1]) == type(child_elements[0])):
                  elements[-1] += child_elements.pop(0)
              elements.extend(child_elements)
              if child.tail is not None:
                  if self._is_inline(child) and len(elements) > 0 and isinstance(elements[-1], element_cls):
                      elements[-1] += element_cls(six.text_type(child.tail), id=id)
                  else:
                      elements.append(element_cls(six.text_type(child.tail), id=id))
          return elements
docs: Recursively parse HTML/XML element and its children into a list of Document elements.