Fixed frontend XML generation (appendFormattedElement)