var app = angular.module('testApp', []);

app.controller('testController', ['$scope', function($scope) {
	
	var xmlText = 	'<MyRoot>'+
						'<test>Success</test>'+
						'<test2>'+
							'<item>val1</item>'+
							'<item>val2</item>'+
						'</test2>'+
						'<test3 id="theId" value="theValue">val3</test3>'+
						'<test4></test4>'+
						'<test5/>'+
					'</MyRoot>';

	$scope.convertXML = function() {
		var start = new Date().getTime();
		$scope.errorText = null;

		try {
			$scope.output = jsonifier.xmlToJSON($scope.xmlTextBox);
		}
		catch (e)
		{
			$scope.errorText = 'Error: ' + e;
		}
		
		var end = new Date().getTime();
		var time = end-start;
		console.log('execution time: ' + time + 'ms');
	};

	$scope.xmlContainsValue = function() {
		$scope.valueFound = jsonifier.xmlContainsValue($scope.xmlTextBox, $scope.valueToFind, $scope.valuePath);
	};

	$scope.getValue = function() {
		var result = jsonifier.getValue($scope.xmlTextBox, $scope.valuePath);
		if (null === result) {
			$scope.valueFound = '-- no value found at given path --';
		}
		else {
			$scope.valueFound = result;
		}
	};

	$scope.xmlContainsNode = function() {
		var result = jsonifier.xmlContainsNode($scope.xmlTextBox, $scope.valuePath);
		if (null === result) {
			$scope.valueFound = '-- no node found at given path --';
		}
		else {
			$scope.valueFound = 'Found a node at ' + $scope.valuePath;
		}
	};

	$scope.clearJSONOutput = function() {
		$scope.output = '';
	};

}]);


@@ -741,32 +741,61 @@
  = function() %7B%0A
+%09%09$scope.clearJSONOutput();%0A%0A
 %09%09$scope.valueFo
@@ -914,32 +914,61 @@
  = function() %7B%0A
+%09%09$scope.clearJSONOutput();%0A%0A
 %09%09var result = j
@@ -1197,24 +1197,59 @@
 unction() %7B%0A
+        $scope.clearJSONOutput();%0A%0A
 %09%09var result

Make the buttons on the test page clear the json output each time to keep the page clean