     /// This is only used for XML Document header (default value is "no").
     public let standalone: String
     
+    /// Options for NSXMLParser (default values are `false`)
     public let xmlParserOptions: NSXMLParserOptions
     
     /// Root (the first child element) element of XML Document **(AEXMLError element if not exists)**.
-    public var root: AEXMLElement { return children.count == 1 ? children.first! : AEXMLElement(AEXMLElement.errorElementName, value: "XML Document must have root element.") }
+    private let errorElement = AEXMLElement(AEXMLElement.errorElementName, value: "XML Document must have root element.")
+    public var root: AEXMLElement { return children.count == 1 ? children.first! : errorElement }
     
     // MARK: Lifecycle
     

/**
    This is base class for holding XML structure.

    You can access its structure by using subscript like this: 
    `element["foo"]["bar"]` would return `<bar></bar>` element from `<element><foo><bar></bar></foo></element>` XML as an `AEXMLElement` object.
*/
public class AEXMLElement: NSObject {
    

        :param: encoding Encoding value for XML Document header (defaults to "utf-8").
        :param: standalone Standalone value for XML Document header (defaults to "no").
        :param: xmlData XML data to parse.
        :param: xmlParserOptions Options for NSXMLParser (defaults to `false` for all).
    
        :returns: An initialized XML Document object containing the parsed data. Throws error if the data could not be parsed.
    */
    public convenience init(version: Double = Defaults.version,
                            encoding: String = Defaults.encoding,
                            standalone: String = Defaults.standalone,
                            xmlData: NSData,
                            xmlParserOptions: NSXMLParserOptions = NSXMLParserOptions()) throws
    {
        self.init(version: version, encoding: encoding, standalone: standalone, xmlParserOptions: xmlParserOptions)
        try loadXMLData(xmlData)
    }
