def addClosedXMLTag(attributes, depth, localName, output, text=''):
	'Add the closed xml tag.'
	depthStart = '\t' * depth
	attributesString = getAttributesString(attributes)
	if len(text) > 0:
		output.write('%s<%s%s >%s</%s>\n' % (depthStart, localName, attributesString, text, localName))
	else:
		output.write('%s<%s%s />\n' % (depthStart, localName, attributesString))