def complete_xml_element(self, xmlnode, doc):
ns = xmlnode.ns()<EOL>if self.instructions is not None:<EOL><INDENT>xmlnode.newTextChild(ns, "<STR_LIT>", to_utf8(self.instructions))<EOL><DEDENT>if self.form:<EOL><INDENT>self.form.as_xml(xmlnode, doc)<EOL><DEDENT>if self.remove:<EOL><INDENT>xmlnode.newChild(ns, "<STR_LIT>", None)<EOL><DEDENT>else:<EOL><INDENT>if self.registered:<EOL><INDENT>xmlnode.newChild(ns, "<STR_LIT>", None)<EOL><DEDENT>for field in legacy_fields:<EOL><INDENT>value = getattr(self, field)<EOL>if value is not None:<EOL><INDENT>xmlnode.newTextChild(ns, field, to_utf8(value))<EOL><DEDENT><DEDENT><DEDENT>
Complete the XML node with `self` content.

        :Parameters:
            - `xmlnode`: XML node with the element being built. It has already
              right name and namespace, but no attributes or content.
            - `doc`: document to which the element belongs.
        :Types:
            - `xmlnode`: `libxml2.xmlNode`
            - `doc`: `libxml2.xmlDoc`