Adding lowercased name to the end element check

Malformed XML error is thrown if the target node has any casing other than lowercase since the node's name is converted to lowercase when the element is opened but not when it's closed.