Converting XML key value pairs

I have used Tika to convert a number of documents into XML. These documents contain metadata in the format

<meta name="Title" content="The Hobbit" />
<meta name="Author" content="Tolkein" />
<meta name="Creation-Date" content="1937-09-21" />

When I use logstash to read in this XML it splits each row into K:V pairs as

{"name": "Title", "content": "The Hobbit"},
...

however when I read this into Elasticsearch I would like to read it as

{"Title": "The Hobbit"},
...

Would I do this in Logstash or through the template file and how would I make this?

I believe you need to use a ruby filter for this. Unfortunately I don't have time to type up an example.