     /// - Returns: the attributed string representing the specified element node.
     ///
     ///
-    private func stringForNode(elementNode: ElementNode) -> NSAttributedString {
-        assert(elementNode.children.count > 0)
-
-        let content = NSMutableAttributedString()
-
-        for child in elementNode.children {
-            let childContent = convert(child)
-
-            content.appendAttributedString(childContent)
-        }
-
-        addAttributes(toString: content, fromNode: elementNode)
+    private func stringForNode(node: ElementNode, withBaseFontDescriptor baseFontDescriptor: UIFontDescriptor) -> NSAttributedString {
+        assert(node.children.count > 0)
+
+        let content = NSMutableAttributedString(string: "XX")
+        let descriptor = fontDescriptor(forNode: node, withBaseFontDescriptor: baseFontDescriptor)
+
+        content.addAttribute(NSFontAttributeName, value: font(forNode: node, withBaseFontDescriptor: baseFontDescriptor), range: NSRange(location: 0, length: content.length))
+
+        let childrenContent = NSMutableAttributedString()
+
+        for child in node.children {
+            let childContent = convert(child, withBaseFontDescriptor: descriptor)
+
+            childrenContent.appendAttributedString(childContent)
+        }
+
+        content.replaceCharactersInRange(NSRange(location: 0, length: content.length), withAttributedString: childrenContent)
+        content.addAttribute(keyForNode(node), value: node, range: NSRange(location: 0, length: content.length))
+        //content.insertAttributedString(childrenContent, atIndex: 1)
 
         return content
     }

    ///
    /// - Returns: the requested symbolic traits.
    ///
    private func symbolicTraits(fromNode node: ElementNode) -> UIFontDescriptorSymbolicTraits {
        var traits = UIFontDescriptorSymbolicTraits(rawValue: 0)

        if isBold(node) {
            traits.insert(.TraitBold)

        self.defaultFontDescriptor = defaultFontDescriptor
    }

    // MARK: - Conversion

    /// Main conversion method.
    ///
    /// - Parameters:
    ///     - node: the node to convert to `NSAttributedString`.
    ///
    /// - Returns: the converted node as an `NSAttributedString`.
    ///
    func convert(node: Node) -> NSAttributedString {
        return convert(node, withBaseFontDescriptor: defaultFontDescriptor)
    }

    /// Recursive conversion method.  Useful for maintaining the font style of parent nodes when
    /// converting.
    ///
    /// - Parameters:
    ///     - node: the node to convert to `NSAttributedString`.
    ///     - baseFontDescriptor: the base font descriptor to use for this node's conversion.  Any
    ///             change to the font style will be applied on top of this base descriptor.
    ///
    /// - Returns: the converted node as an `NSAttributedString`.
    ///
    private func convert(node: Node, withBaseFontDescriptor baseFontDescriptor: UIFontDescriptor) -> NSAttributedString {

        if let textNode = node as? TextNode {
            return convertTextNode(textNode, withBaseFontDescriptor: baseFontDescriptor)
        } else {
            guard let elementNode = node as? ElementNode else {
                fatalError("Nodes can be either text or element nodes.")
            }

            return convertElementNode(elementNode, withBaseFontDescriptor: baseFontDescriptor)
        }
    }

    /// Converts a `TextNode` to `NSAttributedString`.
    ///
    /// - Parameters:
    ///     - node: the node to convert to `NSAttributedString`.
    ///     - baseFontDescriptor: the base font descriptor to use for this node's conversion.
    ///             Text nodes don't have styling information, so this will be used as-is.
    ///
    /// - Returns: the converted node as an `NSAttributedString`.
    ///
    private func convertTextNode(node: TextNode, withBaseFontDescriptor baseFontDescriptor: UIFontDescriptor) -> NSAttributedString {

        let font = UIFont(descriptor: baseFontDescriptor, size: baseFontDescriptor.pointSize)
        let attributes: [String:AnyObject] = [keyForNode(node): node,
                                              NSFontAttributeName: font]

        return NSAttributedString(string: node.text, attributes: attributes)
    }

    /// Converts an `ElementNode` to `NSAttributedString`.
    ///
    /// - Parameters:
    ///     - node: the node to convert to `NSAttributedString`.
    ///     - baseFontDescriptor: the base font descriptor to use for this node's conversion.
    ///             Text nodes don't have styling information, so this will be used as-is.
    ///
    /// - Returns: the converted node as an `NSAttributedString`.
    ///
    private func convertElementNode(node: ElementNode, withBaseFontDescriptor baseFontDescriptor: UIFontDescriptor) -> NSAttributedString {

        if node.children.count == 0 {
            return stringForEmptyNode(node)
        } else {
            return stringForNode(node, withBaseFontDescriptor: baseFontDescriptor)
        }
    }

    // MARK: - Unique Key Generation

    /// Generates a unique ID for the specified node.
    ///
