I need to implement the following markup:

The problem is that I can use only HTML+CSS and XSLT to produce it.
I thought of writing a template that would split the text into lines with XSL and print each line as a different paragraph <p> with border-bottom set. Is there a simpler way to achieve this by means of HTML+CSS?
A small update: The point here is to have this underline extend past the text and take all the available width. So all lines are of the same length (like lines in a copybook), except the first one which may be shorter
You can use an inline element such as
<span>which will treatborder-bottomlike underline:and CSS:
Demo here.
Result using the markup above:
EDIT:
1.
Extending @aefxx’s answer, if you can use CSS3 try this:
Demo here – this will only work in the latest browsers including Firefox and Chrome.
Result in Chrome:
2.
If you’re happy with justified text:
Demo here. There are some issues with line-height but should be easy to figure out.
Result in Chrome:
Other than that, I’m afraid you might have to wrap your lines in some containers.