Could not figure out the problem until I started debugging and found that then end tag "</todo>" was parsed as: </todo> even though it's value was </todo>