I tried calling xmlin using XML::Simple and that almost does everything I want. Thanks for your help. One question: Suppose my XML file is really really big, and I only want to add data that meets a certain criteria (say, where the value of key2 is "Joe"). How do I filter that input?