components/policy/tools/template_writers/writers/xml_formatted_writer.py
def AddElement(self, parent, name, attrs=None, text=None):
    '''
    Adds a new XML Element as a child to an existing element or the Document.

    Args:
      parent: An XML element or the document, where the new element will be
        added.
      name: The name of the new element.
      attrs: A dictionary of the attributes' names and values for the new
        element.
      text: Text content for the new element.

    Returns:
      The created new element.
    '''
    if attrs == None:
      attrs = {}

    doc = parent.ownerDocument
    element = doc.createElement(name)
    for key, value in sorted(attrs.items()):
      element.setAttribute(key, value)
    if text:
      element.appendChild(doc.createTextNode(text))
    parent.appendChild(element)
    return element

    Adds a new XML Element as a child to an existing element or the Document.

    Args:
      parent: An XML element or the document, where the new element will be
        added.
      name: The name of the new element.
      attrs: A dictionary of the attributes' names and values for the new
        element.
      text: Text content for the new element.

    Returns:
      The created new element.
    
Adds a new XML Element as a child to an existing element or the Document.
Adds a new XML Element as a child to an existing element or the Document .
def AddElement(self, parent, name, attrs=None, text=None):
    if attrs == None:
      attrs = {}
    doc = parent.ownerDocument
    element = doc.createElement(name)
    for key, value in sorted(attrs.items()):
      element.setAttribute(key, value)
    if text:
      element.appendChild(doc.createTextNode(text))
    parent.appendChild(element)
    return element
def AddElement ( self , parent , name , attrs = None , text = None ) : if attrs == None : attrs = { } doc = parent . ownerDocument element = doc . createElement ( name ) for key , value in sorted ( attrs . items ( ) ) : element . setAttribute ( key , value ) if text : element . appendChild ( doc . createTextNode ( text ) ) parent . appendChild ( element ) return element
Adds a new XML Element as a child to an existing element or the Document.
Adds a new XML Element as a child to an existing element or the Document .
'''
    Adds a new XML Element as a child to an existing element or the Document.

    Args:
      parent: An XML element or the document, where the new element will be
        added.
      name: The name of the new element.
      attrs: A dictionary of the attributes' names and values for the new
        element.
      text: Text content for the new element.

    Returns:
      The created new element.
    '''
The created new element.
The created new element .
self
parent
An XML element or the document, where the new element will be
added.
An XML element or the document where the new element will be added .
name
The name of the new element.
The name of the new element .
attrs
A dictionary of the attributes' names and values for the new
element.
A dictionary of the attributes ' names and values for the new element .
text
Text content for the new element.
Text content for the new element .