Add ' '
in your HTML tags:
<?php
echo "<form method='post' action='test.php'>";
if(isset($_POST['xx'])) {
$xx = $_POST['xx'];
echo "<input type='text' name='xx' value='$xx'>";
} else {
echo "<input type='text' name='xx'>";
}
echo "<input type='submit' name='submit' value='save'>";
echo "<br />";
var_dump($xx);