# fromXMLNode static method

StanzaError? fromXMLNode(

1. XMLNode node

)

## Implementation

    static StanzaError? fromXMLNode(XMLNode node) {
      final error = node.firstTag('error');
      if (error == null) {
        return null;
      }

      final specificError = error.firstTagByXmlns(fullStanzaXmlns);
      if (specificError == null) {
        return UnknownStanzaError();
      }

      switch (specificError.tag) {
        case RemoteServerNotFoundError.tag:
          return RemoteServerNotFoundError();
        case RemoteServerTimeoutError.tag:
          return RemoteServerTimeoutError();
        case ServiceUnavailableError.tag:
          return ServiceUnavailableError();
      }

      return UnknownStanzaError();
    }