added support for empty tags in getOuterHTML