Add a function to turn objects into XML
Rename $xml to $output
Store the document ID as metadata

This will be useful for tying each law back to its official URL.
Turn each law into XML and store it as a file

This is full of mistakes right now, but it's a good start.