@Override
	public void endElement(String uri, String localName, String qName)
	throws SAXException
	{
		String elementName = getElementName(uri,localName,qName);
		if(!elementStack.peek().element.equals(elementName))
		{
			throw new SAXException("Misplaced end to element " + elementName);
		}
		ElementStackElement endedElement = elementStack.pop();
		if(prettyPrint && endedElement.childCount > 0)
		{
			out.print("\n");
			for(int i = 0;i < elementStack.size();i++) out.print(elementIndentation);
		}
		out.print("</" + elementName + ">");
	}