public void writeStartElement(String name)
    {
        try
        {
            if (lastElement == Elements.OPEN_TAG || lastElement == Elements.ATTRIBUTE)
            {
                xmlWriter.write(">\n");
            }
            else if (lastElement != Elements.STRING)
            {
                xmlWriter.write("\n");
            }
            
            indent();
            
            xmlWriter.write("<" + name);
            elementStack.add(name);
            level++;
            lastElement = Elements.OPEN_TAG;
        }
        catch (IOException ex)
        {
            ex.printStackTrace();
        }
    }