borrows code from TEI Display to render the TEI with stylesheet applied