code: def _addElement(element, key, value):
      """
      Only add attributes to an tag if the key is not None
  
      :param element: the tag element of the xml tree
      :param key: the key of the attribute
      :param value: the value of the attribute
      :return:
      """
  
      if value is not None:
          element.set(key, value)
  
imports: from lxml import etree
  from .data import Page
label_desc: Use image node_id 2 for calling the XMLWriter obj's underlying member method code with example usage: obj._addElement(element, key, value) without return types