Print a XML representation of an object

Simple example of printing a XML representation of an object.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script>
var person = new Object();
    person.postCode = 03126;
    person.surname = "Kennedy";
    person.age = 12;
    
console.dirxml(person);
    
</script>
</body>
</html>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX