Have you had a look at the Getting Started guide?
The general advice is to create a docx containing what you want (preferably in Word, but you could also do it in a recent version of OpenOffice/LibreOffice), and then have a look at it.
When I do that with the things you are asking about, I get:
Using xml Syntax Highlighting
<w:p>
<w:r>
<w:tab/>
<w:t>that was a tab
</w:t>
</w:r>
<w:r>
<w:br/>
<w:t>and that was a new line
</w:t>
</w:r>
</w:p>
Parsed in 0.001 seconds, using
GeSHi 1.0.8.4
You should be able to have all that in the one w:r, so here it is on a plate (albeit untested):
Using java Syntax Highlighting
org.
docx4j.
wml.
ObjectFactory factory
= Context.
getWmlObjectFactory();
org.
docx4j.
wml.
P p
= factory.
createP();
org.
docx4j.
wml.
R run
= factory.
createR();
p.
getContent().
add(run
);
run.
getContent().
add(factory.
createRTab() );
org.
docx4j.
wml.
Text text1
= factory.
createText();
t.
setValue("that was a tab");
run.
getContent().
add(text1
);
run.
getContent().
add(factory.
createBr() );
org.
docx4j.
wml.
Text text2
= factory.
createText();
t.
setValue("and that was a new line");
// Check you got what you expected
System.
out.
println(XmlUtils.
marshaltoString(p,
true));
Parsed in 0.020 seconds, using
GeSHi 1.0.8.4