Several additions to XML->PHP transformation
re #692

Added ln, pn, wn, p@label. Corrected formatting in opening PHP block. Removed `ctboost` prefix on sections.