<p>I would like to parse HTML document and replace action attribute of all the forms and add some hidden fields with XSL. Can someone show some examples of XSL that can do this?</p>

You can start from
this tutorial
But be aware that generally
```
XSLT
```
requires well-formed
```
XML
```
as input and
```
HTML
```
isn't always well-formed