Just because two things have tree-like structures, that doesn't mean it's always trivial to convert between them.
Example 1: some XML dialects (such as XHTML) attach significance to the order in which the elements occur; others (such as RDF/XML) do not; others (like Atom) treat order as significant in some places but not others. Generally speaking, filesystems do not assign any significance to the order elements occur in. A directory containing foo.txt and bar.txt, and another directory containing bar.txt and foo.txt are effectively the same thing. (And diff will certainly treat them the same.)
Example 2: Many XML dialects allow sibling elements to have the same tag name. Given the following XHTML:
<html>
<head />
<body />
</html>
... it might seem obvious to create a top-level directory called html with subdirectories head and body. But then let's expand upon that XHTML...
<html>
<head />
<body>
<p>Foo</p>
<p>Bar</p>
</body>
</html>
... and then the body directory needs to contain two subdirectories, each called p. I don't know of any filesystems that would allow this.
Example 3: filesystems typically have two types on entities: directories and files. XML trees have more: elements, attributes, text nodes, comments, and (admittedly rarely) processing instructions. So you decide you want to represent elements as directories, and attributes as files, how do you represent the rest?
OK, so these are problems which are not insurmountable, but mapping XML's structure to the filesystem is not a trivial exercise at all.
The original poster had a fairly simple problem: how to compare two XML files and get a list of only the differences they care about (e.g. whitespace differences might not be important).
Going the filesystem route, they've swapped one problem for two - now they have to perform a potentially complex mapping from XML to the filesystem, and then find a way to compare two directories and get a list of only the differences they care about.
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
|