Implementing a custom Decoder in Swift 4 : <p>I'd like to decode an XML document using the new <code>Decodable</code> protocol introduced in Swift 4, however, there doesn't seem to be an existing implementation for an XML decoder that conforms to the <code>Decoder</code> protocol.</p>

<p>My plan was to use the SWXMLHash library to parse the XML, then possibly make the <code>XMLIndexer</code> class in that library extend the <code>Decoder</code> protocol so that my model can be initialized with an instance of <code>XMLIndexer</code> (<code>XMLIndexer</code> is returned by <code>SWXMLHash.parse(xmlString)</code>).</p>

<p><a href="https://i.stack.imgur.com/S6n3z.png" rel="noreferrer"><img src="https://i.stack.imgur.com/S6n3z.png" alt="XMLIndexer+Decoder.swift"></a></p>

<p>My issue is that I have no clue how to implement the <code>Decoder</code> protocol and I can't seem to find any resources online that explain how it's done. Every resource that I've found strictly mentions the <code>JSONDecoder</code> class which is included with the Swift standard library and no resource I've found addresses the issue of creating your own custom decoder.</p>
