Take into account self closing tags