docs: def to_xml(self):
          '''
          Returns a DOM representation of the line.
          @return: Element
          '''
          for n, v in {"name": self.name, "quantity": self.quantity,
                       "unit_price": self.unit_price}.items():
              if is_empty_or_none(v):
                  raise LineError("'%s' attribute cannot be empty or None." %
                                      n)
  
          doc = Document()
          root = doc.createElement("line")
          super(Line, self).to_xml(root)
          self._create_text_node(root, "date", self.date)
          self._create_text_node(root, "name", self.name, True)
          self._create_text_node(root, "description", self.description, True)
          self._create_text_node(root, "quantity", self.quantity)
          self._create_text_node(root, "unitPrice", self.unit_price)
          self._create_text_node(root, "unit", self.unit)
          self._create_text_node(root, "gin", self.gin)
          self._create_text_node(root, "gtin", self.gtin)
          self._create_text_node(root, "sscc", self.sscc)
  
          if len(self.__discounts):
              discounts = root.ownerDocument.createElement("discounts")
              root.appendChild(discounts)
              for discount in self.__discounts:
                  if not issubclass(discount.__class__, Discount):
                      raise LineError('discount of type %s is not an ' \
                                      'instance or a subclass of %s' %
                                      (discount.__class__.__name__,
                                       Discount.__name__))
                  discounts.appendChild(discount.to_xml())
  
          if len(self.__taxes):
              taxes = root.ownerDocument.createElement("taxes")
              root.appendChild(taxes)
              for tax in self.__taxes:
                  if not issubclass(tax.__class__, Tax):
                      raise LineError('tax of type %s is not an instance ' \
                                          'or a subclass of %s' %
                                          (tax.__class__.__name__, Tax.__name__))
                  taxes.appendChild(tax.to_xml())
  
          return root