I am writting an Firefox add-on in XUL and I want to include another XUL file within my browser.xul. In PHP I would use something like this: include("anotherFIle.php"); but I don't know the equivalent in XUL. What is the best way to accomplish this?
XUL has an iframe similar to the HTML iframe. However, if you are just trying to add in some UI elements into the pre-existing UI, then look at overlays.
Raw file-includes ala PHP cannot be done in a lot of other languages. XUL is/isn't a imperative programming language so much as a markup language -- and includes just ain't gonnna fly.
You can use an iframe to include another html page, but I don't believe you can include local files, or other XUL.
See Using Remote XUL where you'll get this handy tip:
Support for remote XUL has long been a potential security concern; support for it was removed in Gecko 2.0. This also means you can't load XUL using file:// URLs.
XUL tutorial: content panels suggests that you can include XUL via iframe, but I don't see any working example.