 }
 
 /// Type-erasure for `Element`.
-public struct AnyElement {
-  fileprivate class _Box {
+public struct AnyElement: Element {
+  fileprivate class _Box: Hashable {
     fileprivate var name: String? { _mustBeOverriden() }
     fileprivate var localName: String? { _mustBeOverriden() }
     fileprivate var uri: String? { _mustBeOverriden() }
     fileprivate var stringValue: String? { get { _mustBeOverriden() } set { _mustBeOverriden() } }
     fileprivate func xmlString(options mask:XMLNode.Options) -> String { _mustBeOverriden() }
+    
+    fileprivate func _isEqual(to other:_Box) -> Bool { _mustBeOverriden() }
+    fileprivate static func == (lhs: AnyElement._Box, rhs: AnyElement._Box) -> Bool {
+      return lhs._isEqual(to:rhs)
+    }
+    
+    #if swift(>=4.2)
+    public func hash(into hasher:inout Hasher) { _mustBeOverriden() }
+    #else
+    public var hashValue: Int { _mustBeOverriden() }
+    #endif
     
     fileprivate class _Some<E>: _Box where E: Element {
       fileprivate var _base: E

      fileprivate override func xmlString(options mask: XMLNode.Options) -> String {
        return self._base.xmlString(options:mask)
      }
    }
    
    fileprivate class _TextHolder<E>: _Some<E> where E: TextHolderElement {

  }
  
  private var _box: _Box
  
  public var name: String? { return self._box.name }
  public var localName: String? { return self._box.localName }
  public var uri: String? { return self._box.uri }
  public var stringValue: String? {
    get { return self._box.stringValue }
    set { self._box.stringValue = newValue }
  }
  public func xmlString(options mask: XMLNode.Options) -> String {
    return self._box.xmlString(options:mask)
  }
  
  public static func == (lhs: AnyElement, rhs: AnyElement) -> Bool {
    return lhs._box == rhs._box
  }
  
  #if swift(>=4.2)
  public func hash(into hasher:inout Hasher) { hasher.combine(self._box) }
  #else
  public var hashValue: Int { return self._box.hashValue }
  #endif
  
  /// Initialize with the given element.
  public init<E>(_ element:E) where E:Element {
