docs: public final XmlStringBuilder getChildElementXML(XmlEnvironment enclosingXmlEnvironment) {
          XmlStringBuilder xml = new XmlStringBuilder();
          if (type == Type.error) {
              // Add the error sub-packet, if there is one.
              appendErrorIfExists(xml, enclosingXmlEnvironment);
          }
          else if (childElementName != null) {
              // Add the query section if there is one.
              IQChildElementXmlStringBuilder iqChildElement = getIQChildElementBuilder(new IQChildElementXmlStringBuilder(this));
              if (iqChildElement != null) {
                  xml.append(iqChildElement);
  
                  List<ExtensionElement> extensionsXml = getExtensions();
                  if (iqChildElement.isEmptyElement) {
                      if (extensionsXml.isEmpty()) {
                           xml.closeEmptyElement();
                           return xml;
                      } else {
                          xml.rightAngleBracket();
                      }
                  }
                  xml.append(extensionsXml);
                  xml.closeElement(iqChildElement.element);
              }
          }
          return xml;
      }