Replace specified tags in PHP

Take a look at the HTML example below:


<html>
<body>
    <h1>Click on the button below:</h1>
    <Com:Button Text="Click here" />
</body>
</html>

I want to search for the tag name “Com” --> Search for it´s prefix “Button” --> Get the param “Text” and replace the whole tag with <input type=“button” value=“Click here” />. How can this be done in an effective way?

I think I continue here… Anyone who have an solution for extending the DOM class in PHP5 so you can use elements like <com:Button /> when parsing (X)HTML documents?