Important update on the issue, seemingly the URL www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd is very slow, this is most likely the real culprit.
Timings from my browser show that it takes 15 seconds to download the 7,9 kB file. I don't know how it relates to the 8 invocations the profiler measured, but the elapsed time in building is a multiple of 4 of the download time.