Opc.Ua.BinaryDecoder.ReadXmlElement C# (CSharp) Method

ReadXmlElement() public method

Reads an XmlElement from the stream.
public ReadXmlElement ( string fieldName ) : XmlElement
fieldName string
return System.Xml.XmlElement
        public XmlElement ReadXmlElement(string fieldName)
        {
            byte[] bytes = ReadByteString(fieldName);

            if (bytes == null || bytes.Length == 0)
            {
                return null;
            }
            
            XmlDocument document = new XmlDocument();
            document.InnerXml = new UTF8Encoding().GetString(bytes, 0, bytes.Length);

            return document.DocumentElement;
        }