'Sets up the initial relations between this element and
other elements.'

def setup(self, parent=None, previous_element=None, next_element=None, previous_sibling=None, next_sibling=None):

    self.parent = parent
    self.previous_element = previous_element
    if (previous_element is not None):
        self.previous_element.next_element = self
    self.next_element = next_element
    if self.next_element:
        self.next_element.previous_element = self
    self.next_sibling = next_sibling
    if self.next_sibling:
        self.next_sibling.previous_sibling = self
    if ((not previous_sibling) and (self.parent is not None) and self.parent.contents):
        previous_sibling = self.parent.contents[(-1)]
    self.previous_sibling = previous_sibling
    if previous_sibling:
        self.previous_sibling.next_sibling = self
