Answering the question "How to Debug"
It starts with gathering the information that's missing from your post. Information that could potentially help future people having the same problem.
First, the complete stack trace. An out-of-memory exception that's thrown from within the XML parser is very different from one thrown from your code.
Second, the size of the XML file, because "not long at all" is completely useless. Is it 1K, 1M, or 1G? How many elements.
Third, how are you parsing? SAX, DOM, StAX, something completely different?
Fourth, how are you using the data. Are you processing one file or multiple files? Are you accidentally holding onto data after parsing? A code sample would help here (and a link to some 3rd-party site isn't terribly useful for future SO users).