         case .Element(let element):
             return try [element].map{ try T.deserialize( XMLIndexer($0) ) }
         default:
-            throw XMLDeserializationError.InvalidNode(node: self)
+            throw XMLDeserializationError.NodeIsInvalid(node: self)
         }
     }
 }

        case .Element(let element):
            return try [element].map { try T.deserialize( XMLIndexer($0) ) }
        default:
            throw XMLDeserializationError.InvalidNode(node: self)
        }
    }
    

    func nonEmptyTextOrThrow() throws -> String {
        if let text = self.text where text.characters.count > 0 {
            return text
        } else { throw XMLDeserializationError.NodeHasNoValue }
    }
}

public enum XMLDeserializationError: ErrorType, CustomStringConvertible {
    case ImplementationIsMissing(method: String)
    case NodeIsInvalid(node: XMLIndexer)
    case NodeHasNoValue
    case TypeConversionFailed(type: String, element: XMLElement)
    
    public var description: String {
        switch self {
        case .ImplementationIsMissing(let method):
            return "This deserialization method is not implemented: \(method)"
        case .NodeIsInvalid(let node):
            return "This node is invalid: \(node)"
        case .NodeHasNoValue:
            return "This node is empty"
        case .TypeConversionFailed(let type, let node):
            return "Can't convert node \(node) to value of type \(type)"
        }
    }
}
