Added support for self-closing elements.