# buildErrorElement function

XMLNode buildErrorElement(

1. String type,
2. String condition,
3. {String? text}

)

Build an <error> element with a child <`condition` type="`type`" />. If `text` is not null, then the condition element will contain a <text> element with `text` as the body.</text></error>

## Implementation

    XMLNode buildErrorElement(String type, String condition, {String? text}) {
      return XMLNode(
        tag: 'error',
        attributes: <String, dynamic>{'type': type},
        children: [
          XMLNode.xmlns(
            tag: condition,
            xmlns: fullStanzaXmlns,
            children: [
              if (text != null)
                XMLNode.xmlns(
                  tag: 'text',
                  xmlns: fullStanzaXmlns,
                  text: text,
                ),
            ],
          ),
        ],
      );
    }