Correctly deal with invalid content in non-selfclosing tags. Fixes #297
Add test for #197. Fixes #197
layer srs is inherited from map srs

Do not output srs attribute when srs is undefined,
since layer srs is inherited from map srs, it is optional.
Add test for #294