     /// Matching element names, element values, attribute names, attribute values
     /// will be case insensitive. This will not affect parsing (data does not change)
     public var caseInsensitive = false
+    
+    /// Encoding used for XML parsing. Default is set to UTF8
+    public var encoding = String.Encoding.utf8
 }
 
 /// Simple XML parser

    - returns: an `XMLIndexer` instance that can be iterated over
    */
    public func parse(_ xml: String) -> XMLIndexer {
        return parse(xml, using: String.Encoding.utf8)
    }
    
    /**
     Begins parsing the passed in XML string.
     
     - parameters:
     - xml: an XML string. __Note__ that this is not a URL but a
     - encoding: Encoding use to parse xml
     string containing XML.
     - returns: an `XMLIndexer` instance that can be iterated over
     */
    public func parse(_ xml: String, using encoding: String.Encoding) -> XMLIndexer {
        return parse(xml.data(using: encoding)!)
    }

    /**
    Begins parsing the passed in XML string.


            return "XML Element Error: Incorrect index [\"\(index)\"]"
        case .initialize(let instance):
            return "XML Indexer Error: initialization with Object [\"\(instance)\"]"
        case .encoding:
            return "String Encoding Error"
        case .error:
            return "Unknown Error"
        }
