transform.py: write bracketed trees