Validate the default.xml with XML DTD schema

Change-Id: I7563cc1e3fab6583e839011c85cdcab46d327018
diff --git a/validate_manifest.sh b/validate_manifest.sh
new file mode 100755
index 0000000..a582322
--- /dev/null
+++ b/validate_manifest.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+# validate_manifest.sh
+#
+# Validates the repo manifest, per the DTD format given here:
+# https://gerrit.googlesource.com/git-repo/+/master/docs/manifest-format.txt
+
+echo "Verifying default.xml using manifest.dtd"
+
+# check that xmllint is available
+if ! [ -x "$(command -v xmllint)" ]
+then
+  echo "Please install 'xmllint' to use this script"
+  exit 1
+fi
+
+# run the verification
+xmllint --noout --dtdvalid manifest.dtd default.xml
+status=$?
+
+if [ $status -ne 0 ]
+then
+  echo "FAILURE: default.xml isn't valid - exit status: $status"
+  exit $status
+else
+  echo "SUCCESS: default.xml validated correctly"
+  exit 0
+fi