This is what the file looks like: <?xml version="1.0" encoding="latin-1"?> <!DOCTYPE doc SYSTEM "doc.dtd" [ <!ENTITY foo SYSTEM "foo.xml"> <!ENTITY bar SYSTEM "bar.xml"> ]> <doc> &foo; &bar; </doc> I would like to change one entity declaration pointing to a different file using DOM and write the file back to disc. thx Juergen